xorp service file

Dhionel Díaz ddiaz at cenditel.gob.ve
Thu Sep 10 00:46:46 BST 2015


El 09/09/15 a las 16:34, Felipe Sateler escribió:
> Hi Dhionel,
> 
> On 9 September 2015 at 17:38, Dhionel Díaz <ddiaz at cenditel.gob.ve> wrote:
>> Hi everyone,
>>
>> Following the directions in https://wiki.debian.org/systemd/HowToHelp
>> I've attached a service file I've written for the xorp daemon, it has
>> been tested in one of our production routers.
> 
> Great!
> 
>>
>> I'll be awaiting your review.
>>
>> [Unit]
>> Description=eXtensible Open Router Platform
>> After=network.target remote-fs.target
> 
> I don't think remote-fs.target is required here, as having
> DefaultDependencies=yes (the default) ensures all the basic
> filesystems are mounted.

Ok, I see. I'll remove it.

> 
>>
>> [Service]
>> EnvironmentFile=-/etc/default/xorp
>> ExecStart=/usr/sbin/xorp_rtrmgr $DAEMON_OPTS
> 
> It would be better to pass the option to daemonize and make the
> service Type=forking, otherwise systemd does not know when the service
> is successfully started.
> 
> Maybe even pass -P and specify PIDFile= so that systemd knows for sure
> what the main process is.

I'm confused. I thought the recommended approach was to make the service
run in foreground, in order to optimize the startup and monitoring.
Also, as far as I've verified no package depends on xorp; maybe that's
normal for a routing daemon.

Another reason to implement the foreground behavior was to deactivate
the weekly restart that the logrotate script executes when a pid file is
found; that restart is not longer needed because with the proposed
configuration the log messages are sent to the journal via stderr.

As an alternative, ¿do you think it would be appropriate to include a
sd_notify call in xorp_rtrmgr main process and then use Type=notify?

> 
>> TimeoutStopSec=233
> 
> Why this weird value?

It's just a nice number to specify an almost four minute timeout. The
init script implements a two minute timeout, but in my experience xorp
is rather slow to stop and when the router is highly loaded that might
not be enough time. So I've incremented it using, given the oportunity,
a somewhat special number.

> 
>> Restart=always
> 
> I don't know if xorp can be told to exit, but this would cause it to
> be restarted in such a case.
> 

As far as I've verified, xorp cannot be told to exit via its command
interface (xorpsh); maybe that's also normal in a routing daemon.
Therefore, the rationale was to indicate that the service should always
be available after it's enabled and started.

>>
>> [Install]
>> WantedBy=multi-user.target
> 
> Looks good otherwise to me!
> 
> 

Thanks for your time.

Regards,

-- 
Dhionel Díaz
Centro Nacional de Desarrollo e Investigación en Tecnologías Libres
Ministerio del Poder Popular para Educación Universitaria, Ciencia y
Tecnología

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150909/7453a4aa/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list