Autostart service when debian boot up
On Monday 11 January 2010 13:23:57 pch0317 wrote:
> I want to start service "service1" when debian boot up, but with "user1"
> rights (not root rights).
> Is this possible?
Yes, some services do it automatically. Some services have a setting under
/etc/defaults for what user to run as. Some services use their own
configuration under /etc to control this.
It is rather service specific, assuming you want the service to actually work.
Since it may need some permissions during start-up that it can drop later, or
it may need to leave a stub process behind to handle a few actions that
require extra permissions.
> If yes, how I can do that.
It depends on the service. In general, init scripts are run as a privledges
process and they can either use su (with the -c option) or sudo (the first is
generally preferred in this case) to switch to another use and execute
commands as that user. If su or sudo are not ideal for some reason (needing
early permissions), the daemon/service/binary itself would be started with
privileges that it can drop with setuid/setgid calls.
If you have a particular service in mind, please reply with that information.
It's possible someone else on the list has experience with that service and
can give more specific information.
Boyd Stephen Smith Jr. ,= ,-_-. =.
email@example.com ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'