OLD | NEW |
1 /* upstart | 1 /* upstart |
2 * | 2 * |
3 * Copyright © 2009 Canonical Ltd. | 3 * Copyright © 2009 Canonical Ltd. |
4 * Author: Scott James Remnant <scott@netsplit.com>. | 4 * Author: Scott James Remnant <scott@netsplit.com>. |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2, as | 7 * it under the terms of the GNU General Public License version 2, as |
8 * published by the Free Software Foundation. | 8 * published by the Free Software Foundation. |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 /* SIGHUP instructs us to re-load our configuration */ | 236 /* SIGHUP instructs us to re-load our configuration */ |
237 nih_signal_set_handler (SIGHUP, nih_signal_handler); | 237 nih_signal_set_handler (SIGHUP, nih_signal_handler); |
238 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); | 238 NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL)); |
239 | 239 |
240 /* SIGUSR1 instructs us to reconnect to D-Bus */ | 240 /* SIGUSR1 instructs us to reconnect to D-Bus */ |
241 nih_signal_set_handler (SIGUSR1, nih_signal_handler); | 241 nih_signal_set_handler (SIGUSR1, nih_signal_handler); |
242 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); | 242 NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL)); |
243 #endif /* DEBUG */ | 243 #endif /* DEBUG */ |
244 | 244 |
| 245 /* Start performance logging using these hardcoded files. |
| 246 * TODO(kmixter): We'll want to make the files and fields |
| 247 * configurable eventually. |
| 248 */ |
| 249 perf_log_set_files ("/proc/uptime", |
| 250 "/sys/block/sda/stat", |
| 251 "/var/log/perf.log"); |
| 252 |
245 | 253 |
246 /* Watch children for events */ | 254 /* Watch children for events */ |
247 NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, | 255 NIH_MUST (nih_child_add_watch (NULL, -1, NIH_CHILD_ALL, |
248 job_process_handler, NULL)); | 256 job_process_handler, NULL)); |
249 | 257 |
250 /* Process the event queue each time through the main loop */ | 258 /* Process the event queue each time through the main loop */ |
251 NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll, | 259 NIH_MUST (nih_main_loop_add_func (NULL, (NihMainLoopCb)event_poll, |
252 NULL)); | 260 NULL)); |
253 | 261 |
254 | 262 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 NihError *err; | 547 NihError *err; |
540 | 548 |
541 err = nih_error_get (); | 549 err = nih_error_get (); |
542 nih_warn ("%s: %s", _("Unable to connect to the system b
us"), | 550 nih_warn ("%s: %s", _("Unable to connect to the system b
us"), |
543 err->message); | 551 err->message); |
544 nih_free (err); | 552 nih_free (err); |
545 } | 553 } |
546 } | 554 } |
547 } | 555 } |
548 #endif /* DEBUG */ | 556 #endif /* DEBUG */ |
OLD | NEW |