in reply to How run a daemon as non-root user

Ubuntu lets users control root programs with sudo. What you do is put your username and program in the /etc/sudoers file, and I believe there is a nopasswd option, so you don't need to enter the passwd everytime, like with su.

Google for "/etc/sudoers" and read the tutorials. If you set it up right, you keep the root perms on the daemon script, and run it, as a user, with "sudo myscript". It should launch with root permissions.


I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: How run a daemon as non-root user
by duckyd (Hermit) on Dec 05, 2008 at 21:38 UTC
    Unless I read the original post incorrectly, the poster is explicitly trying to avoid launching the daemons with root permissions...
        Well the pid is stored in /var/run and I can't put together the information to create a user like postgres or apache that can create a pid in /var/run other than root.

        I realize this is probably a silly question, so I can't imagine the answer would be too complicated. It's probably more of a OS issue than Perl, like I said I'm running Debian/Linux.