Activate/Deactivate Modules using Sudo

Technical issues/questions of an intermediate or advanced nature.
Post Reply
jssouza
DEV Team
DEV Team
Posts: 243
Joined: 09 Jul 2015, 14:17
Distribution: Porteus x86 arm
Location: Liechtenstein

Activate/Deactivate Modules using Sudo

Post#1 by jssouza » 11 Oct 2016, 12:33

Can sudo be used to activate/deactivate modules as guest? Executing activate using sudo has an error in aufs-insert saying losetup was not found. I guess this is because losetup is in /sbin and not in the guest's PATH.

Code: Select all

guest@porteus:/mnt/sdb1$ sudo activate test_mod.xzm 
Quiet mode: off
/opt/porteus-scripts/xorg/aufs-insert: line 44: losetup: command not found
A similar error occurs in aufs-remove while performing deactivate using sudo.

Code: Select all

/opt/porteus-scripts/xorg/aufs-remove: line 61: losetup: command not found

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Activate/Deactivate Modules using Sudo

Post#2 by Bogomips » 11 Oct 2016, 12:43

^ IMHO this question should be under Intermediate/Advanced User Questions.

Usually have in guiexec script PATH+=:/sbin before using sudo to activate, and seems to work ok.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3216
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Activate/Deactivate Modules using Sudo

Post#3 by Ed_P » 11 Oct 2016, 13:01

Bogomips wrote:^ IMHO this question should be under Intermediate/Advanced User Questions.
I agree. Need to get a mod to move it. :lol:
Usually have in guiexec script PATH+=:/sbin before using sudo to activate, and seems to work ok.
Does the PATH change end when the script ends or does it carry on till rebooted?
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Activate/Deactivate Modules using Sudo

Post#4 by Bogomips » 11 Oct 2016, 20:29

Ed_P wrote:[Does the PATH change end when the script ends or does it carry on till rebooted?
AFAIK it remains in that process, if not exported, and does not propagate down through the sub-processes.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
brokenman
Site Admin
Site Admin
Posts: 5517
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Activate/Deactivate Modules using Sudo

Post#5 by brokenman » 12 Oct 2016, 02:54

Executing activate using sudo has an error in aufs-insert saying losetup was not found. I guess this is because losetup is in /sbin and not in the guest's PATH.
Hmmm. Thanks, your assumptions are correct. I'll take a look.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply