Page 1 of 1

Activate/Deactivate Modules using Sudo

Posted: 11 Oct 2016, 12:33
by jssouza
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

Re: Activate/Deactivate Modules using Sudo

Posted: 11 Oct 2016, 12:43
by Bogomips
^ 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.

Re: Activate/Deactivate Modules using Sudo

Posted: 11 Oct 2016, 13:01
by Ed_P
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?

Re: Activate/Deactivate Modules using Sudo

Posted: 11 Oct 2016, 20:29
by Bogomips
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.

Re: Activate/Deactivate Modules using Sudo

Posted: 12 Oct 2016, 02:54
by brokenman
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.