DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-07-09 05:09:16

mc625569
New member
Registered: 2009-07-09
Posts: 2

How can I start a service as the "nobody" user

Hello, I just dont know enough linux to solve this issue. I have searched the forums and read through the wiki and I cant seem to find an answer I understand.

In short:

DNS 323 with fun_plug .5

I have installed nzbget and it runs fine when i start it when logged in  via  telnet as root.

Id like to start this as a daemon on bootup, but I dont want the process itself to run as root, I want it to run as nobody, like samba does.

Since this process actually downloads files, its creating files with root permissions, meaning my windows clients (accessing shares as 'nobody') cannot manipulate these new files as I would like.

Is there a way I can start my NZBGET daemon as the nobody user?

Ive hacked it in the past with the setgid command on the folder, I know this is not the best way to do it, but it appears I dont have this command in this limited system.

Any advice would be appreciated.


thanks,

MC

Offline

 

#2 2009-07-09 09:37:23

wortelsoft
Member
From: Netherlands
Registered: 2009-06-08
Posts: 52

Re: How can I start a service as the "nobody" user

I've put a chown (change owner) command in the postprocess script. I tried running nzbget as a user but it didn't work and at that time I didn't want to put any more effort in.

Offline

 

#3 2009-07-09 09:54:48

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How can I start a service as the "nobody" user

Code:

root@bob:~# whoami
root
root@bob:~# su nobody -c whoami
nobody

Offline

 

#4 2009-07-09 18:57:10

mc625569
New member
Registered: 2009-07-09
Posts: 2

Re: How can I start a service as the "nobody" user

Thanks fonz.

I was having syntactical problems with my nzbget start commands, and I realized that using qotes was good for my health.

su nobody -c  'nzbget -D -c /path/to/conf/file'   works like a charm

Last edited by mc625569 (2009-07-09 19:08:27)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB