trdlo / client175

Automatically exported from code.google.com/p/client175
GNU General Public License v3.0
0 stars 0 forks source link

How are we supposed to start this at boot time? #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've been trying out client175 and must say it looks great so far.

But it's confusing me because I don't see how to start it in the background. 
I've started it the way described on wiki.
It starts and spews log data all down the screen. I tried starting it with "&" 
as a background process but it does the same. I tried piping to a log file and 
it still outputs on the terminal.

I'm trying to set it up along with MPD on a small home server.

What is the correct way to start it in background as a server, writing to a log 
file? Can this be added to the wiki? It needs to start as non-root at boot time 
right, along with mpd ideally. I can create an upstart init script for it but 
obviously it currently doesn't write to a log file...?

I'd love to get this working! It looks great - and if it works for me I'll be 
switching from Songbird to use this. I can write python code too and would love 
to contribute.

Thanks.

Original issue reported on code.google.com by chrissav...@gmail.com on 26 Sep 2010 at 5:24

GoogleCodeExporter commented 8 years ago
Ok. I found the "production" setting in the conf file now.
I started it as "&" background and it seems to work.
I suppose it should be started "sudo -u xxx" to prevent running as root?

It would be awesome if it could fork itself as a given user like most servers.

That quiets it down. But does the output go to a log file?
Or just vanish. I'm not that concerned to see an access.log like a web site but 
I'm just curious if it's available.

Original comment by chrissav...@gmail.com on 26 Sep 2010 at 6:00

GoogleCodeExporter commented 8 years ago
I've modified my copy to support running as a different user during system 
init. This was useful for me since on Ubuntu we use upstart now. So I created 
an upstart job (client175.conf) to run client175. I don't know if there is 
another way to change user from root but this works for me.

I've attached a simple patch here in case you think this is useful to merge in.

Original comment by chrissav...@gmail.com on 26 Sep 2010 at 8:00

Attachments:

GoogleCodeExporter commented 8 years ago
And here is my upstart conf file too. In case it's useful to someone...

Original comment by chrissav...@gmail.com on 26 Sep 2010 at 8:05

Attachments:

GoogleCodeExporter commented 8 years ago
hanks for the patch and example upstart file!  Truthfully, I just hadn't gotten 
around to this yet, development has been paused for a little while.

I'll merge this feature in soon.

I would appreciate any contributions.  If you have a specific idea or are 
looking for more info, email me at cseickel at gmail or post on the group:  
http://groups.google.com/group/client175

Original comment by cseic...@gmail.com on 28 Sep 2010 at 11:16

GoogleCodeExporter commented 8 years ago
No worries. I've been playing around with it a little. I like how it updates 
with the status from mpd. I've got Lirc working with mpd and so when I use the 
remote control and pause/play the web page knows right away.

I've got it all set up fairly well now on my little mini-itx Ubuntu server box. 
I have mpd start when I turn on my external drive using udev rules, and stop if 
I turn it off. Client175 follows along too. And so far the upstart stuff has 
been working fine.

Here's my stripped down version of a mpd upstart job as well. It doesn't do 
quite everything as the init.d script did but it does work as is, and Client175 
will start together with it, and shutdown when my udev rule detects my drive 
down.

Original comment by chrissav...@gmail.com on 28 Sep 2010 at 2:38

Attachments:

GoogleCodeExporter commented 8 years ago
I finally made a new release (0.4) which includes your run_as patch.  I also 
added this to the GettingStarted page.  Thanks for the good ideas!

Original comment by cseic...@gmail.com on 20 Nov 2010 at 6:02

GoogleCodeExporter commented 8 years ago
Your web client is the best! However if I comment or uncomment the:
environment: "production"

line it still keeps printing output to the console, which means I can't close 
the terminal emulator, and I can't run it at startup. It works flawelessly when 
I access it from a web browser, but on the server machine it just hangs there 
and keeps printing stuff to the console. I'm running it with "exec python 
server.py &"

Original comment by fma...@gmail.com on 13 Apr 2012 at 4:12