From: pch0317 on
Hi List

I want to start service "service1" when debian boot up, but with "user1"
rights (not root rights).
Is this possible?
If yes, how I can do that.

Thanks


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Boyd Stephen Smith Jr. on
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. ,= ,-_-. =.
bss(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
From: pch0317 on
Boyd Stephen Smith Jr. wrote:
> 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.
I think about jboss and jboss user.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org