~ubuntu-branches/ubuntu/karmic/upstart/karmic-updates

« back to all changes in this revision

Viewing changes to init/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant, Steve Langasek
  • Date: 2009-10-01 15:26:19 UTC
  • Revision ID: james.westby@ubuntu.com-20091001152619-tb508a8ahqdp6wvt
Tags: 0.6.3-6
* Don't use "telinit q" to reconnect to D-Bus, since that breaks
  lots of things.  Invent another secret way instead.

[ Steve Langasek ]
* upstart-job's restart target must also not fail when the service is not
  yet started.  LP: #430883.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
static void kbd_handler     (void *data, NihSignal *signal);
68
68
static void pwr_handler     (void *data, NihSignal *signal);
69
69
static void hup_handler     (void *data, NihSignal *signal);
 
70
static void usr1_handler    (void *data, NihSignal *signal);
70
71
#endif /* DEBUG */
71
72
 
72
73
 
235
236
        /* SIGHUP instructs us to re-load our configuration */
236
237
        nih_signal_set_handler (SIGHUP, nih_signal_handler);
237
238
        NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL));
 
239
 
 
240
        /* SIGUSR1 instructs us to reconnect to D-Bus */
 
241
        nih_signal_set_handler (SIGUSR1, nih_signal_handler);
 
242
        NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL));
238
243
#endif /* DEBUG */
239
244
 
240
245
 
512
517
{
513
518
        nih_info (_("Reloading configuration"));
514
519
        conf_reload ();
 
520
}
515
521
 
 
522
/**
 
523
 * usr1_handler:
 
524
 * @data: unused,
 
525
 * @signal: signal that called this handler.
 
526
 *
 
527
 * Handle having recieved the SIGUSR signal, which we use to instruct us to
 
528
 * reconnect to D-Bus.
 
529
 **/
 
530
static void
 
531
usr1_handler (void      *data,
 
532
              NihSignal *signal)
 
533
{
516
534
        if (! control_bus) {
517
535
                nih_info (_("Reconnecting to system bus"));
518
536