[systemd-devel] Non-target, dependency-only unit

Lennart Poettering lennart at poettering.net
Fri Jan 20 19:27:56 PST 2012


On Mon, 16.01.12 16:54, Pablo Hess (natunobilis at gentoobr.org) wrote:

> > [Service]
> > Type=oneshot
> > ExecStart=/usr/sbin/spacewalk-service start
> > ExecReload=/usr/sbin/spacewalk-service reload
> > ExecStop=/usr/sbin/spacewalk-service stop
> > RemainAfterExit=yes
> 
> Thank you, Jóhann.
> 
> Yes, this unit file is a simple solution, but I was looking for
> something with more of a native approach.
> 
> One of the obnoxious things about the wrapper script is that it waits
> until tomcat has opened its socket:
> 
> while [ -f "/var/run/$TOMCAT.pid" ] ; do
>        /usr/sbin/lsof -t -i TCP:8009 -p $(cat /var/run/$TOMCAT.pid) >
> /dev/null && break
>        sleep 1
> done

Wow, that's evil. Normally tomcat should not return from its
initialization before the socket is successfully created. It's really
bad style having sleep loops like this.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list