[SATLUG] Runlevel Switching
tom weeks
tweeksjunk2 at theweeks.org
Thu Jan 4 00:05:35 CST 2007
On Wednesday 03 January 2007 18:57, Bruce Dubbs wrote:
> HickBilly wrote:
> >> To add to what Jeremy said, I always used 'telinit', which upon
> >> researching it just now is apparently very similar to 'init'. So,
> >>
> >> prompt> telinit 3
On most GNU/Linux distros.. it's just a symlink to init:
# ls -la /sbin/telinit
lrwxrwxrwx 1 root root 4 Nov 21 23:16 /sbin/telinit -> init
telinit is a remnant of yesteryear..
> 1. You have to be root. su -
> 2. telinit is in /sbin which may not be in your path. Try /sbin/telinit 3
Again... in most distros you still must be root:
$ /sbin/init 5
init: must be superuser.
or some PAM configs will allow for this if you do it from a virtual terminal
(CTRL-ALT-F1 as Kelly previously pointed out). If your distro won't allow
non root access to this command, then you may be able to do some PAM hacking
to fix this:
cp -a /etc/pam.d/poweroff /etc/pam.d/init
hmm.. not quite that simple.. I ran an strace on it and it looks like you
would need to recompile init:
...
munmap(0x2aaaaaaac000, 4096) = 0
umask(022) = 022
geteuid() = 500
write(2, "init: must be superuser.\n", 25init: must be superuser.
) = 25
exit_group(1)
sorry..
Kelly? Any other ideas?
I would set up an alias for init to call "sudo /sbin/init" and then map that
in the sodoers file.. that should work.
Tweeks
More information about the SATLUG
mailing list