Commit graph

77 commits

Author SHA1 Message Date
Eelco Dolstra 1da362b34b Fix coverage data collection
http://hydra.nixos.org/build/3253046
2012-10-30 17:27:14 +01:00
Eelco Dolstra 23390147ea upstart.nix: Treat "daemon" as "forking" 2012-10-26 16:22:19 +02:00
Eelco Dolstra c980faebe2 upstart.nix: Set ‘Type’ to ‘oneshot’ for Upstart tasks
This way the service will only reach the "started" state when the task
has finished.
2012-10-23 08:30:50 -04:00
Eelco Dolstra a4cad32c3d Generate more user-friendly script filenames
This is primarily important in journal entries.
2012-10-18 11:58:37 -04:00
Eelco Dolstra 285f587025 Move non-interface specific initialisation to ‘network-setup.service’
The unit ‘network-interface.service’ has been replaced by
‘network-interfaces.target’.
2012-10-11 16:18:48 -04:00
Eelco Dolstra 2044ae785d Use "wants" instead of "requires" 2012-10-02 10:32:29 -04:00
Eelco Dolstra 7932978617 Fix Upstart compatibility jobs that depend on "stopped udevtrigger"
It's not enough to say "after udev-settle.service" since
udev-settle.service is not wanted/required anywhere - we need to say
"wants udev-settle.service" as well.

This should fix problems with ALSA and X11 initialisation that people
have been seeing.
2012-10-02 10:31:02 -04:00
Eelco Dolstra ca13a913d9 Oops, lost some code 2012-10-01 18:20:22 -04:00
Eelco Dolstra 891be375b5 Make unitConfig/serviceConfig attribute sets
So instead of:

  boot.systemd.services."foo".serviceConfig =
    ''
      StartLimitInterval=10
      CPUShare=500
    '';

you can say:

  boot.systemd.services."foo".serviceConfig.StartLimitInterval = 10;
  boot.systemd.services."foo".serviceConfig.CPUShare = 500;

This way all unit options are available and users can set/override
options in configuration.nix.
2012-10-01 16:27:42 -04:00
Eelco Dolstra b02c488fde Automatically append ".service" to the name of service units 2012-08-23 10:25:27 -04:00
Eelco Dolstra 36e05e8dd2 Add some more backward compatibility hacks 2012-08-20 11:21:11 -04:00
Eelco Dolstra a44e575196 switch-to-configuration: Respect the ‘restartIfChanged’ attribute 2012-08-17 13:14:42 -04:00
Eelco Dolstra 981347429a Add support for PartOf dependencies 2012-08-15 15:36:54 -04:00
Eelco Dolstra a44a7271a8 Warn about Upstart modules with an unknown startOn condition 2012-08-14 17:30:11 -04:00
Eelco Dolstra b11c5d5991 nscd: Ensure that invalidate-nscd starts after nscd 2012-08-06 12:26:52 -04:00
Eelco Dolstra 9f9ae7c7e9 Share option definitions between the systemd and Upstart compatibility modules 2012-08-06 11:45:59 -04:00
Eelco Dolstra fd2cef50cd Don't pull in Upstart 2012-07-20 18:25:23 -04:00
Eelco Dolstra 02e37ba6b0 Shorten filenames of start scripts to make log messages more readable 2012-07-19 17:41:42 -04:00
Eelco Dolstra 4c21857ee1 Upstart ‘boot.systemd.services’ for the Upstart compatibility layer 2012-06-18 17:42:26 -04:00
Eelco Dolstra 673bf12b1d Improve the dependencies of units generated by the Upstart emulation 2012-06-18 00:22:18 -04:00
Eelco Dolstra 42ee3b4209 Add a ‘wantedBy’ attribute to unit definitions
This attribute allows a unit to make itself a dependency of another unit.

Also, add an option to set the default target unit.
2012-06-17 23:31:21 -04:00
Eelco Dolstra 4a95f8996b To ease migration to systemd, generate units from the ‘jobs’ option
Also get rid of the ‘buildHook’ job option because it wasn't very useful.
2012-06-16 00:19:43 -04:00
Eelco Dolstra a46894b960 Get lots more systemd stuff working
Enabled a bunch of units that ship with systemd.  Also added an option
‘boot.systemd.units’ that can be used to define additional units
(e.g. ‘sshd.service’).
2012-06-14 18:44:56 -04:00
Eelco Dolstra 03f2847054 * Set preferLocalBuild on a few trivial top-level derivations. These
tend to cause a lot of unnecessary I/O to the build machines.

svn path=/nixos/trunk/; revision=33936
2012-04-26 15:19:23 +00:00
Eelco Dolstra d9e28560d1 * Emit "expect daemon" for the mountall task. Otherwise it may get a
USR1 signal before it has forked into the background (because it
  will be in the start/running state immediately).

svn path=/nixos/trunk/; revision=33288
2012-03-20 10:17:08 +00:00
Eelco Dolstra f546837cdf * Don't use replaceChars. It's slow.
svn path=/nixos/trunk/; revision=33270
2012-03-19 18:07:28 +00:00
Eelco Dolstra fcc2e985a2 * Handle jobs that fail while a post-start script is waiting for them.
svn path=/nixos/trunk/; revision=33269
2012-03-19 18:07:05 +00:00
Eelco Dolstra 8ca2aff772 * Get rid of some grep hackery on the Upstart jobs.
svn path=/nixos/trunk/; revision=33240
2012-03-18 18:53:50 +00:00
Eelco Dolstra 362d1389d3 * mountall: make the "console output" Upstart stanza do its work. We
were redirecting output to /var/log/upstart/<job>, so it didn't work
  properly.
* mountall-ip-up: send the USR1 signal to the mountall process by
  looking up its PID, rather than doing "pkill -USR1 mountall".  This
  prevents a very subtle race condition where USR1 is delivered to a
  child process of mountall (such as fsck), if pkill sees the child
  just before its execve().  There is actually still a race condition
  because mountall installs its USR1 handler *after* daemonising, so
  mountall-ip-up could accidentally kill mountall.  Should report this
  to upstream.

svn path=/nixos/trunk/; revision=33236
2012-03-18 17:48:19 +00:00
Eelco Dolstra 86d8d62d16 * Allow Upstart jobs to declare that they shouldn't be restarted by
switch-to-configuration.  E.g. the X server shouldn't be restarted
  because that kills all the X clients.

svn path=/nixos/trunk/; revision=33223
2012-03-18 02:10:39 +00:00
Eelco Dolstra 3495a773f9 * Improved Upstart job handling in switch-to-configuration. It no
longer compares the current configuration to the previous
  configuration, but instead compares the current Upstart state to the
  intended state.  Thus, if the switch script is interrupted, running
  nixos-rebuild again will resume starting/stopping Upstart jobs where
  the previous run left off.

  We determine if an Upstart job has changed by having the pre-start
  script of each Upstart job put a symlink to its .conf file in
  /var/run/upstart-jobs.  So if this symlink differs from the target
  of /etc/init/<job>.conf, then the job has changed.  This also
  prevents multiple restarts of dependent jobs.  E.g., if job B has
  "start on started A" and "stop on stopping A", then restarting A
  will cause B to be restarted, so B shouldn't B restarted a second
  time.

  We only start jobs that are not running if 1) they're tasks that
  have been previously run (like mountall); or 2) they're jobs that
  have a "start on" condition.  This seems a reasonable heuristic.

svn path=/nixos/trunk/; revision=33222
2012-03-18 01:53:35 +00:00
Eelco Dolstra ee6c9bb998 * Provide two utility functions in Upstart jobs: "ensure JOBNAME"
starts the given job and waits until it's running; "stop_check"
  checks that the current job hasn't been asked to stop.

svn path=/nixos/trunk/; revision=33214
2012-03-17 19:12:33 +00:00
Eelco Dolstra 8935db253c * Upstart jobs: don't emit a description if there is none.
svn path=/nixos/trunk/; revision=32775
2012-03-04 16:17:56 +00:00
Mathijs Kwik dc8ca0ea4a upstart: options for setuid and setgid
as jobs running as different users cannot create their logfile, I moved that to an activationScript

svn path=/nixos/trunk/; revision=32762
2012-03-04 12:58:06 +00:00
Eelco Dolstra 84bff53ca7 * Set the default value for the ‘path’ job attribute using the NixOS
module system so that it can be overriden.  Also use an ‘apply’ to
  compute the actual $PATH.

svn path=/nixos/trunk/; revision=32440
2012-02-20 19:23:15 +00:00
Peter Simons eb6e1310b8 strip trailing whitespace; no functional change
svn path=/nixos/trunk/; revision=29285
2011-09-14 18:20:50 +00:00
Nicolas Pierron ef63ea98f4 Experiment with dual option types (list & attribute sets).
svn path=/nixos/trunk/; revision=27978
2011-07-27 20:55:35 +00:00
Eelco Dolstra c2f7256101 * Added an option `system.upstartEnvironment' to add a variable to all
Upstart jobs.

svn path=/nixos/trunk/; revision=25478
2011-01-09 22:00:41 +00:00
Eelco Dolstra 8a6fad83f4 * Add a job attribute (path) to allow adding packages to the job's
$PATH environment variable.

svn path=/nixos/trunk/; revision=23780
2010-09-14 11:22:17 +00:00
Lluís Batlle i Rossell b25771532a Fixing the postfix start/stop (through an upstart job script code that will
monitor the life of postfix)

Adding an assert to upstart jobs, so those with preStop will always need an exec or
script, otherwise the preStop will not be run.


svn path=/nixos/trunk/; revision=22225
2010-06-11 21:44:06 +00:00
Eelco Dolstra ad93acc295 * Make all Upstart jobs shut down on the `starting shutdown' event.
This ensures that they're gone by the time the shutdown job runs, so
  it doesn't have to stop them itself.
* Don't respawn tasks, as it doesn't seem useful (if they fail they're
  likely to fail again if they're restarted).

svn path=/nixos/trunk/; revision=22099
2010-06-02 16:04:08 +00:00
Eelco Dolstra 94b2268192 * Start "exec" jobs using the "script" stanza to allow redirects in
the job's "exec" to work properly.

svn path=/nixos/trunk/; revision=22094
2010-06-01 20:41:59 +00:00
Eelco Dolstra 95a9c5dd77 * Log the standard output/error of Upstart jobs to
/var/log/upstart/<jobname> rather than spamming the console with it.

svn path=/nixos/trunk/; revision=22093
2010-06-01 19:44:23 +00:00
Eelco Dolstra 5b5aefa030 * Remove some obsolete stuff.
svn path=/nixos/trunk/; revision=20631
2010-03-15 13:41:21 +00:00
Eelco Dolstra 4253490fd4 svn path=/nixos/trunk/; revision=20016 2010-02-15 15:55:54 +00:00
Marc Weber aad3d21ceb upstart: quote environment vars. John Altobelli hit the case TZ=New York
svn path=/nixos/trunk/; revision=19633
2010-01-23 22:38:30 +00:00
Eelco Dolstra d7342c78d4 * Support pre-stop scripts. These are needed to cleanly shutdown
daemons such as Apache or PostgreSQL.

svn path=/nixos/branches/upstart-0.6/; revision=18234
2009-11-06 22:45:19 +00:00
Eelco Dolstra b9bfe7ed43 * Connect Upstart to the system bus.
svn path=/nixos/branches/upstart-0.6/; revision=18213
2009-11-06 15:59:23 +00:00
Eelco Dolstra 9fa2f12cc2 * Do some more jobs.
svn path=/nixos/branches/upstart-0.6/; revision=18212
2009-11-06 15:46:56 +00:00
Eelco Dolstra 903e92bde6 * Use Upstart's "export fork" feature to properly detect when a daemon
is "ready".  This prevents ugly race conditions, e.g. HAL failing to
  start because dbus hasn't finished starting yet.
* Support post-start scripts.  These are executed after the job's main
  process has started but before the job's "started" event is
  emitted.  For instance, the udev job uses this to perform "udevadm
  trigger / settle" to create all devices.  Previously this had to be
  done in the pre-start script, so the daemon had to started in the
  pre-start script as well.

svn path=/nixos/branches/upstart-0.6/; revision=18211
2009-11-06 15:23:16 +00:00