How to launch a daemon conditionally?

Scott James Remnant scott at netsplit.com
Thu Feb 7 22:22:22 GMT 2008


On Thu, 2008-02-07 at 13:02 -0800, upstart at eehouse.org wrote:

> I want to modify /etc/event.d/ttyS2 to not launch getty when
> /dev/ttyS2 is not present.
> 
You could do it as a single script:

	start on runlevel 2
	stop on runlevel [!2]

	pre-start exec [ -e /dev/ttyS2 ] || stop

	exec /sbin/getty -L ttyS2 115200 vt100
	respawn

But that still at least attempts to start it.

The "correct" way (which is still being worked on):

	while tty-present
	exec /sbin/getty -L $TTY 115200 vt100

(tty-present being defined as:
	from tty-added
	until tty-removed $TTY)

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20080207/03fc6401/attachment.pgp 


More information about the upstart-devel mailing list