[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Custom Reload command/signal in upstart



 ❦  1 juin 2013 00:44 CEST, Steve Langasek <vorlon@debian.org> :

>> start on (local-filesystems and net-device-up IFACE!=lo)
>> stop on runlevel [016]
>
> FYI, it's strongly recommended to use 'start on runlevel [2345]' here as the
> start condition, for several reasons:
>
>  - The 'filesystem' events are one-time events seen only at boot time; if
>    the admin drops the system to runlevel 1 and then returns to runlevel 2,
>    you probably want the service to restart.
>  - The event name is 'local-filesystem', not 'local-filesystems', so this
>    job wouldn't auto-start at all.  (FWIW, the 'initctl check-config'
>    command from the upstart package would warn about this; but this tool is
>    only usable when upstart is the running init, so probably not ideal for
>    packagers not running upstart themselves.)
>  - The 'local-filesystem' event may be emitted before any remote filesystems
>    have been mounted... which might include part or all of /usr and /var.
>    So since php5-fpm is itself not a service that is used for mounting
>    remote filesystems, it should not try to start until the filesystem is
>    completely up.
>
> The 'runlevel' event is later than both the 'local-filesystem' event and the
> 'net-device-up' events, except in the case where your network interface is
> configured with network-manager instead of ifupdown.  So you shouldn't need
> to worry about this causing your service to start too "early".

The upstart cookbook does not exactly match what you say (so, it may
need an update):

  http://upstart.ubuntu.com/cookbook/#normal-start

I had huge difficulties to get an upstart job that starts after static
network configuration has been done. I have things like this:

  start on (static-network-up or started networking)
  start on (local-filesystems and net-device-up IFACE!=lo)
  start on (filesystem and net-device-up IFACE=vlan481)

The first one is here to be compatible with older upstart (like the one
in Lucid).

It seems that now, we can do this, but the cookbook also says this is
not here yet:

  start on started network-services

I don't know how systemd behaves in this way (so this is not something
to hold against upstart), but there are so many daemons that need to be
started after the network has been configured that it should be easy to
do this. For example, most daemons binding to a specific address needs
to be started after the address has been configured.
-- 
printk(KERN_ERR "msp3400: chip reset failed, penguin on i2c bus?\n");
	2.2.16 /usr/src/linux/drivers/char/msp3400.c

Attachment: pgp08qk9glypy.pgp
Description: PGP signature


Reply to: