2013/4/25 Romain Beauxis <[email protected]>:
> 2013/4/25 Romain Beauxis <[email protected]>:
>> 2013/4/24 Leonard de Ruijter <[email protected]>:
>>> Hello Romain and others,
>>
>>   Hi Leonard,
>>
>>> I've made some significant progress and now have a working git
>>> buildpackage for Arch Linux.
>>
>> Thanks for this work!
>>
>>> Before I'm going to upload it to the Arch
>>> User Repo, I have the following remarks/questions:
>>> 1. The logrotate script contains the following postrotate script:
>>>    postrotate
>>>      for liq in /var/run/liquidsoap/*.pid ; do
>>>        if test $liq != '/var/run/liquidsoap/*.pid' ; then
>>>          start-stop-daemon --stop --signal USR1 --quiet --pidfile $liq
>>>        fi
>>>      done
>>>    endscript
>>> Although start-stop-daemon is available in the arch repository, it isn't
>>> installed by default. I also didn't find the package installed by
>>> default on an OpenSuse system. How about using the more generic way of
>>> accomplishing the same?
>>>    postrotate
>>>      for liq in /var/run/liquidsoap/*.pid ; do
>>>        if test $liq != '/var/run/liquidsoap/*.pid' ; then
>>>          kill -s USR1 `cat $liq`
>>>        fi
>>>      done
>>>    endscript
>>> It is still somewhat buggy. Imagine a situation where a liquidsoap
>>> daemon closes and the pidfile isn't being removed. I need to dive in
>>> this somewhat more to give a better solution to let the logrotate script
>>> whether the process is running before killing.
>>
>> I think this is a very good suggestion. A lot of daemon-related things
>> in liquidsoap are very debian-specifics and we should get rid of them
>> or make then more portable.
>>
>> As for the case where process has closed but PID file is still here, I
>> do not think it is a big deal and it's probably very unlikely that
>> another process has this PID and that a USR1 signal to that process
>> would cause any problem.
>>
>> I will review this later and commit something, most probably your
>> version later (not in the next 10 days tho I fear), in the mean time
>> let us know what you end-up using for your package..
>>
>>> Also, it would be nice if
>>> liquidsoap removes te PIDFile after closing.
>>
>> So, liquidsoap was historically put in daemon mode through the
>> debian-specific start-stop-daemon. However, some time ago, support for
>> daemonized mode was also added in ocaml-dtools, which liquidsoap uses.
>> Thus, you should be able to ask liquidsoap to run in daemon mode,
>> either by setting:
>>   set("init.daemon",false)
>> in your script or by using the --daemon option. If you go that route,
>> you will have several options that you can use, including:
>>   set("init.daemon.pidfile",true)
>>   set("init.daemon.pidfile.path","<sysrundir>/<script>.pid")
>> which should allow liquidsoap to write and remove PID file (or so I hope!)
>
> My bad, I can see now that PID file is created but not removed. Woops!
>
> I'm putting that on my TODO and will add it for 1.1.1 (coming soon)

Alright, this should do the trick:
  
https://github.com/savonet/ocaml-dtools/commit/b1a3fd060a49a507d625a308d07573b1b7853f65

Romain

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to