PDA

View Full Version : Run server as me.



Millwood
2007-10-19, 12:28
I'd like to run the slimserver as me rather than as slimserver, but still use start-stop-daemon and init.d.

This is under debian.

I tried hacking at the slimserver script in init.d but can't get it to work. If I change the user to me, I'm told that something can't change gid to nobody.

Please point me at info, or help me explain coherently what I'm trying to do.

SuperQ
2007-10-19, 13:13
I'd like to run the slimserver as me rather than as slimserver, but still use start-stop-daemon and init.d.

This is under debian.

I tried hacking at the slimserver script in init.d but can't get it to work. If I change the user to me, I'm told that something can't change gid to nobody.

Please point me at info, or help me explain coherently what I'm trying to do.

You should be able to change the SLIMUSER in /etc/init.d/slimserver from "$NAME" to your username. However you will need to fix all the permissions for the various files to be owned by you.

You don't want to change the NAME variable.

I think this set of chowns will work:

rm /var/run/slimserver.pid
chown -R millwood /etc/slimserver /var/log/slimserver /var/cache/slimserver

Millwood
2007-10-19, 13:19
Found it. The source of /etc/default/slimserver in /etc/init.d/slimserver sets SLIMUSER back to slimserver!

Once I overrode SLIMUSER downstream of this all was well.

Thanks.

Mark Miksis
2007-10-19, 13:24
Out of curiosity, why do you want to do this?

Millwood
2007-10-19, 20:27
I want the playlist and log files to be owned and writable by me - I have daemons that process them.

I record internet radio that I listen to once. I used zapped playlist to drive a delete daemon.

asteinmetz
2007-11-01, 13:10
...along those lines I want to copy my Windows slimserver.prefs to my new Ubuntu box but I can't because I don't own the file. I understand chown but I don't want to own the file I just want permission to change it. Can I do that without ownership somehow? Thanks.

SumnerH
2007-11-01, 14:18
...along those lines I want to copy my Windows slimserver.prefs to my new Ubuntu box but I can't because I don't own the file. I understand chown but I don't want to own the file I just want permission to change it. Can I do that without ownership somehow? Thanks.

1. You can make it world writable:

chmod o+rw filename

That's dangerous if anyone who can log in to the machine shouldn't have write privs on the file.

2. You can create a group that you are in (and slimserver or whoever else is in), chgrp it to that group, and
chmod g+rw filename

3. More advanced stuff is possible with ACLs but gets tricky and non-portable even between filesystems.

If it's on a Windows partition, the priv stuff may be different (and make sure that the partition is mounted without ro)