upstart/upstart-tty-stack.patch
2008-03-02 23:29:26 +00:00

2388 lines
55 KiB
Diff

=== modified file 'init/Makefile.am'
--- init/Makefile.am 2007-10-11 21:00:43 +0000
+++ init/Makefile.am 2008-02-29 21:38:58 +0000
@@ -16,6 +16,7 @@
init_SOURCES = \
main.c \
+ tty.c tty.h\
errors.h paths.h \
process.c process.h \
job.c job.h \
=== modified file 'init/Makefile.in'
--- init/Makefile.in 2008-03-02 23:21:30 +0000
+++ init/Makefile.in 2008-02-29 21:39:16 +0000
@@ -70,9 +70,9 @@
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(sbin_PROGRAMS)
-am_init_OBJECTS = main.$(OBJEXT) process.$(OBJEXT) job.$(OBJEXT) \
- event.$(OBJEXT) control.$(OBJEXT) notify.$(OBJEXT) \
- cfgfile.$(OBJEXT)
+am_init_OBJECTS = main.$(OBJEXT) tty.$(OBJEXT) process.$(OBJEXT) \
+ job.$(OBJEXT) event.$(OBJEXT) control.$(OBJEXT) \
+ notify.$(OBJEXT) cfgfile.$(OBJEXT)
init_OBJECTS = $(am_init_OBJECTS)
am__DEPENDENCIES_1 =
init_DEPENDENCIES = ../upstart/libupstart.la ../nih/libnih.la \
@@ -308,6 +308,7 @@
init_SOURCES = \
main.c \
+ tty.c tty.h\
errors.h paths.h \
process.c process.h \
job.c job.h \
@@ -468,6 +469,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_job.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_notify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_process.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tty.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
=== modified file 'init/control.c'
--- init/control.c 2007-03-13 17:25:34 +0000
+++ init/control.c 2008-03-01 08:00:46 +0000
@@ -43,6 +43,7 @@
#include <upstart/message.h>
#include "job.h"
+#include "tty.h"
#include "control.h"
#include "notify.h"
@@ -57,6 +58,11 @@
static int control_job_find (void *data, pid_t pid,
UpstartMessageType type,
const char *pattern);
+static int control_push_tty (void *data, pid_t pid,
+ UpstartMessageType type,
+ const char *device);
+static int control_pop_tty (void *data, pid_t pid,
+ UpstartMessageType type);
static int control_job_query (void *data, pid_t pid,
UpstartMessageType type,
const char *name, unsigned int id);
@@ -96,6 +102,10 @@
static UpstartMessage message_handlers[] = {
{ -1, UPSTART_VERSION_QUERY,
(UpstartMessageHandler)control_version_query },
+ { -1, UPSTART_PUSH_TTY,
+ (UpstartMessageHandler)control_push_tty },
+ { -1, UPSTART_POP_TTY,
+ (UpstartMessageHandler)control_pop_tty },
{ -1, UPSTART_LOG_PRIORITY,
(UpstartMessageHandler)control_log_priority },
{ -1, UPSTART_JOB_FIND,
@@ -308,6 +318,66 @@
nih_io_send_message (control_io, message);
}
+/**
+ * control_push_tty:
+ * @data: data pointer,
+ * @pid: origin process id,
+ * @type: message type received.
+ *
+ * This function is called to change the current tty.
+ *
+ * Returns: zero on success, negative value on raised error.
+ **/
+static int
+control_push_tty (void *data,
+ pid_t pid,
+ UpstartMessageType type,
+ const char *device)
+{
+ NihIoMessage *reply;
+
+ nih_assert (pid > 0);
+ nih_assert (type == UPSTART_PUSH_TTY);
+
+ nih_info (_("Control request to change tty"));
+
+ NIH_MUST (reply = upstart_message_new (control_io, pid,
+ UPSTART_TTY,
+ push_tty (device)));
+ nih_io_send_message (control_io, reply);
+
+ return 0;
+}
+
+/**
+ * control_pop_tty:
+ * @data: data pointer,
+ * @pid: origin process id,
+ * @type: message type received.
+ *
+ * This function is called to revert the most recent tty change.
+ *
+ * Returns: zero on success, negative value on raised error.
+ **/
+static int
+control_pop_tty (void *data,
+ pid_t pid,
+ UpstartMessageType type)
+{
+ NihIoMessage *reply;
+
+ nih_assert (pid > 0);
+ nih_assert (type == UPSTART_POP_TTY);
+
+ nih_info (_("Control request to revert changed tty"));
+
+ NIH_MUST (reply = upstart_message_new (control_io, pid,
+ UPSTART_TTY,
+ pop_tty ()));
+ nih_io_send_message (control_io, reply);
+
+ return 0;
+}
/**
* control_version_query:
=== modified file 'init/main.c'
--- init/main.c 2007-03-13 19:13:19 +0000
+++ init/main.c 2008-03-02 03:14:59 +0000
@@ -58,6 +58,7 @@
#include "control.h"
#include "cfgfile.h"
#include "paths.h"
+#include "tty.h"
/* Prototypes for static functions */
@@ -190,6 +191,8 @@
if (! (restart || rescue))
reset_console ();
+ tty_stack_init ();
+
/* Set the PATH environment variable */
setenv ("PATH", PATH, TRUE);
=== modified file 'init/process.c'
--- init/process.c 2007-10-11 21:08:38 +0000
+++ init/process.c 2008-03-02 21:22:05 +0000
@@ -51,6 +51,7 @@
#include "job.h"
#include "process.h"
#include "paths.h"
+#include "tty.h"
/* Prototypes for static functions */
@@ -385,10 +386,11 @@
break;
- case CONSOLE_OUTPUT:
+ case CONSOLE_OUTPUT: {
/* Ordinary console input and output */
- fd = open (CONSOLE, O_RDWR | O_NOCTTY);
+ fd = open (current_tty (), O_RDWR | O_NOCTTY);
break;
+ }
case CONSOLE_OWNER:
/* As CONSOLE_OUTPUT but with ^C, etc. sent */
=== added file 'init/tty.c'
--- init/tty.c 1970-01-01 00:00:00 +0000
+++ init/tty.c 2008-03-02 21:18:03 +0000
@@ -0,0 +1,97 @@
+/* upstart
+ *
+ * tty.c - tty change events
+ *
+ * Copyright © 2007 Canonical Ltd.
+ * Author: Scott James Remnant <scott@ubuntu.com>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <nih/logging.h>
+#include <nih/string.h>
+#include <nih/alloc.h>
+
+#include "paths.h"
+
+static char **tty_stack = NULL;
+static size_t tty_stack_top = 0;
+
+/**
+ * tty_stack_init:
+ *
+ * Allocate the tty stack
+ **/
+void
+tty_stack_init (void)
+{
+ NIH_MUST (tty_stack = nih_str_array_new (NULL));
+}
+
+/**
+ * current_tty:
+ *
+ * Get the tty at the top of the stack
+ **/
+const char *
+current_tty (void)
+{
+ if (!tty_stack_top) return CONSOLE;
+ return tty_stack[tty_stack_top - 1];
+}
+
+/**
+ * tty_stack_init:
+ *
+ * Push a tty onto the tty stack
+ **/
+const char *
+push_tty (const char *tty)
+{
+ nih_assert (tty_stack != NULL);
+ NIH_MUST (nih_str_array_add (&tty_stack, NULL, &tty_stack_top, tty));
+
+ return current_tty ();
+}
+
+/**
+ * pop_tty:
+ *
+ * Pop a tty off of the tty stack
+ **/
+const char *
+pop_tty (void)
+{
+ nih_assert (tty_stack != NULL);
+ if (tty_stack_top == 0) return current_tty();
+ nih_free (tty_stack[tty_stack_top - 1]);
+ tty_stack[--tty_stack_top] = NULL;
+ tty_stack = nih_realloc (tty_stack, NULL,
+ sizeof (char *) * (tty_stack_top + 2));
+
+ return current_tty ();
+}
+
=== added file 'init/tty.h'
--- init/tty.h 1970-01-01 00:00:00 +0000
+++ init/tty.h 2008-03-02 03:09:57 +0000
@@ -0,0 +1,35 @@
+/* upstart
+ *
+ * Copyright © 2007 Canonical Ltd.
+ * Author: Scott James Remnant <scott@ubuntu.com>.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef INIT_TTY_H
+#define INIT_TTY_H
+
+#include <nih/macros.h>
+
+NIH_BEGIN_EXTERN
+
+const char *current_tty (void);
+const char *push_tty (const char *tty);
+const char *pop_tty (void);
+void tty_stack_init (void);
+
+NIH_END_EXTERN
+
+#endif /* INIT_TTY_H */
=== modified file 'po/ca.po'
--- po/ca.po 2007-10-11 21:20:43 +0000
+++ po/ca.po 2008-02-28 15:56:28 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: upstart\n"
"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
-"POT-Creation-Date: 2007-10-11 22:13+0100\n"
+"POT-Creation-Date: 2008-02-28 10:56-0500\n"
"PO-Revision-Date: 2006-09-18 16:07+0000\n"
"Last-Translator: Jordi Mallach <jordi@canonical.com>\n"
"Language-Team: Catalan <ca@li.org>\n"
@@ -22,46 +22,46 @@
msgid "display list of commands"
msgstr "mostra aquesta ajuda i surt"
-#: nih/command.c:141
+#: nih/command.c:139
#, c-format
msgid "For a list of commands, try `%s help'."
msgstr ""
-#: nih/command.c:144
+#: nih/command.c:142
msgid "COMMAND [OPTION]... [ARG]..."
msgstr ""
-#: nih/command.c:162
+#: nih/command.c:160
#, fuzzy, c-format
msgid "%s: missing command\n"
msgstr "%s: manca un argument: %s\n"
-#: nih/command.c:170
+#: nih/command.c:168
#, fuzzy, c-format
msgid "%s: invalid command: %s\n"
msgstr "%s: l'opció és invàlida: --%s\n"
-#: nih/command.c:181
+#: nih/command.c:179
#, c-format
msgid "%s [OPTION]..."
msgstr ""
-#: nih/command.c:424
+#: nih/command.c:418
#, c-format
msgid "For more information on a command, try `%s COMMAND --help'.\n"
msgstr ""
-#: nih/command.c:450
+#: nih/command.c:444
#, fuzzy, c-format
msgid "%s commands:\n"
msgstr "Opcions %s:\n"
-#: nih/command.c:452
+#: nih/command.c:446
#, fuzzy, c-format
msgid "Other commands:\n"
msgstr "Altres opcions:\n"
-#: nih/command.c:454
+#: nih/command.c:448
#, c-format
msgid "Commands:\n"
msgstr ""
@@ -70,7 +70,7 @@
msgid "Unhandled Error"
msgstr "Error no gestionat"
-#: nih/io.c:1203
+#: nih/io.c:1198
msgid "Error while reading from descriptor"
msgstr "S'ha produït un error en llegir del descriptor"
@@ -101,60 +101,60 @@
msgid "output version information and exit"
msgstr "mostra la informació sobre la versió i surt"
-#: nih/option.c:299
+#: nih/option.c:297
#, c-format
msgid "%s: invalid option: -%c\n"
msgstr "%s: l'opció és invàlida: -%c\n"
-#: nih/option.c:392
+#: nih/option.c:390
#, c-format
msgid "%s: invalid option: --%s\n"
msgstr "%s: l'opció és invàlida: --%s\n"
-#: nih/option.c:408
+#: nih/option.c:406
#, c-format
msgid "%s: unexpected argument: --%s\n"
msgstr "%s: no s'esperava l'argument: --%s\n"
-#: nih/option.c:464
+#: nih/option.c:462
#, c-format
msgid "%s: missing argument: %s\n"
msgstr "%s: manca un argument: %s\n"
-#: nih/option.c:664
+#: nih/option.c:660
#, fuzzy, c-format
msgid "%s: illegal argument: %s\n"
msgstr "%s: manca un argument: %s\n"
-#: nih/option.c:862
+#: nih/option.c:858
msgid "Usage"
msgstr "Forma d'ús"
-#: nih/option.c:866
+#: nih/option.c:862
msgid "[OPTION]..."
msgstr ""
-#: nih/option.c:915
+#: nih/option.c:911
#, c-format
msgid "Report bugs to <%s>\n"
msgstr "Informeu-ne del errors a <%s>\n"
-#: nih/option.c:941
+#: nih/option.c:937
#, c-format
msgid "%s options:\n"
msgstr "Opcions %s:\n"
-#: nih/option.c:943
+#: nih/option.c:939
#, c-format
msgid "Other options:\n"
msgstr "Altres opcions:\n"
-#: nih/option.c:945
+#: nih/option.c:941
#, c-format
msgid "Options:\n"
msgstr "Opcions:\n"
-#: nih/watch.c:521
+#: nih/watch.c:560
msgid "Unable to watch directory"
msgstr ""
@@ -300,82 +300,92 @@
msgid "Deleting %s job"
msgstr "S'està tornant a exiecutar %s"
-#: init/control.c:216
+#: init/control.c:225
#, fuzzy, c-format
msgid "Error on control socket: %s"
msgstr "S'ha produït un error en llegir el missatge de control: %s"
-#: init/control.c:336
+#: init/control.c:345
+#, fuzzy
+msgid "Control request to change tty"
+msgstr "Petició de control per a iniciar %s"
+
+#: init/control.c:379
+#, fuzzy
+msgid "Control request to revert changed tty"
+msgstr "Petició de control per a iniciar %s"
+
+#: init/control.c:413
#, fuzzy
msgid "Control request for our version"
msgstr "Petició de control per a consultar l'estat de %s"
-#: init/control.c:369
+#: init/control.c:446
#, fuzzy
msgid "Control request to change logging priority"
msgstr "Petició de control per a iniciar %s"
-#: init/control.c:406
+#: init/control.c:483
#, fuzzy, c-format
msgid "Control request for jobs matching %s"
msgstr "Petició de control per a consultar l'estat de %s"
-#: init/control.c:408
+#: init/control.c:485
#, fuzzy
msgid "Control request for all jobs"
msgstr "Petició de control per a consultar l'estat de %s"
-#: init/control.c:470
+#: init/control.c:547
#, fuzzy, c-format
msgid "Control request for status of %s"
msgstr "Petició de control per a consultar l'estat de %s"
-#: init/control.c:474
+#: init/control.c:551
#, fuzzy, c-format
msgid "Control request for status of job #%u"
msgstr "Petició de control per a consultar l'estat de %s"
-#: init/control.c:528
+#: init/control.c:605
#, c-format
msgid "Control request to start %s"
msgstr "Petició de control per a iniciar %s"
-#: init/control.c:532
+#: init/control.c:609
#, fuzzy, c-format
msgid "Control request to start job #%u"
msgstr "Petició de control per a iniciar %s"
-#: init/control.c:615
+#: init/control.c:692
#, c-format
msgid "Control request to stop %s"
msgstr "Petició de control per a aturar %s"
-#: init/control.c:619
+#: init/control.c:696
#, fuzzy, c-format
msgid "Control request to stop job #%u"
msgstr "Petició de control per a aturar %s"
-#: init/control.c:748
+#: init/control.c:825
#, fuzzy, c-format
msgid "Control request to emit %s event"
msgstr "Petició de control per a aturar %s"
-#: init/control.c:779
+#: init/control.c:856
#, c-format
msgid "Control request to subscribe %d to jobs"
msgstr "Petició de control per a subscriure %d als treballs"
-#: init/control.c:810
+#: init/control.c:887
#, c-format
msgid "Control request to unsubscribe %d from jobs"
msgstr "Petició de control per a desubscriure %d dels treballs"
-#: init/control.c:840
+#: init/control.c:917
#, c-format
msgid "Control request to subscribe %d to events"
msgstr ""
-#: init/control.c:871
+#: init/control.c:948
#, c-format
msgid "Control request to unsubscribe %d from events"
msgstr ""
@@ -405,7 +415,7 @@
msgid "%s state changed from %s to %s"
msgstr ""
-#: init/job.c:817 util/initctl.c:787
+#: init/job.c:817 util/initctl.c:828
#, c-format
msgid "%s respawning too fast, stopped"
msgstr ""
@@ -480,7 +490,7 @@
"actually run /sbin/telinit."
msgstr ""
-#: init/main.c:136 util/initctl.c:366 compat/sysv/reboot.c:203
+#: init/main.c:136 util/initctl.c:373 compat/sysv/reboot.c:203
#: compat/sysv/shutdown.c:322 compat/sysv/telinit.c:91
msgid "Need to be root"
msgstr "Es necessita ser root"
@@ -552,175 +562,180 @@
msgid "Failed to open console: %s"
msgstr ""
-#: util/initctl.c:396 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
+#: util/initctl.c:403 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
#, c-format
msgid "Unable to send message: %s"
msgstr "No es pot enviar el missatge: %s"
-#: util/initctl.c:447
+#: util/initctl.c:454
#, fuzzy, c-format
msgid "Unable to receive message: %s"
msgstr "No es pot enviar el missatge: %s"
-#: util/initctl.c:464
+#: util/initctl.c:471
#, fuzzy, c-format
msgid "Unable to handle message: %s"
msgstr "No es pot enviar el missatge: %s"
-#: util/initctl.c:534
+#: util/initctl.c:541
#, c-format
msgid "%s (instance)"
msgstr ""
-#: util/initctl.c:605
+#: util/initctl.c:612
#, fuzzy, c-format
msgid "%s, process %d"
msgstr "Procés %s actiu (%d)"
-#: util/initctl.c:607
+#: util/initctl.c:614
#, fuzzy, c-format
msgid "%s, (main) process %d"
msgstr "Procés %s actiu (%d)"
-#: util/initctl.c:620
+#: util/initctl.c:627
#, fuzzy, c-format
msgid "\t%s process %d"
msgstr "Procés %s actiu (%d)"
-#: util/initctl.c:731
+#: util/initctl.c:772
#, c-format
msgid "%s: goal changed"
msgstr ""
-#: util/initctl.c:793
+#: util/initctl.c:834
#, fuzzy, c-format
msgid "%s %s process killed by %s signal"
msgstr "El procés %s (%d) ha estat mort pel senyal %d"
-#: util/initctl.c:796
+#: util/initctl.c:837
#, fuzzy, c-format
msgid "%s %s process killed by signal %d"
msgstr "El procés %s (%d) ha estat mort pel senyal %d"
-#: util/initctl.c:801
+#: util/initctl.c:842
#, fuzzy, c-format
msgid "%s %s process terminated with status %d"
msgstr "El procés %s (%d) ha finalitzat amb l'estat %d"
-#: util/initctl.c:890
+#: util/initctl.c:931
#, c-format
msgid "No jobs matching `%s'"
msgstr ""
-#: util/initctl.c:894
+#: util/initctl.c:935
msgid "No jobs registered"
msgstr ""
-#: util/initctl.c:1226
+#: util/initctl.c:1267
#, c-format
msgid "Unknown job: %s"
msgstr ""
-#: util/initctl.c:1228
+#: util/initctl.c:1269
#, c-format
msgid "Unknown job: #%d"
msgstr ""
-#: util/initctl.c:1271
+#: util/initctl.c:1312
#, fuzzy, c-format
msgid "Invalid job: %s"
msgstr "%s: l'opció és invàlida: --%s\n"
-#: util/initctl.c:1314
+#: util/initctl.c:1355
#, c-format
msgid "Job not changed: %s"
msgstr ""
-#: util/initctl.c:1462
+#: util/initctl.c:1503
#, c-format
msgid "%s event failed"
msgstr ""
-#: util/initctl.c:1581 util/initctl.c:1618 util/initctl.c:1671
-#: util/initctl.c:1708 util/initctl.c:1761
+#: util/initctl.c:1622 util/initctl.c:1659 util/initctl.c:1712
+#: util/initctl.c:1749 util/initctl.c:1802
#, fuzzy, c-format
msgid "%s: invalid job id: %s\n"
msgstr "%s: l'opció és invàlida: --%s\n"
-#: util/initctl.c:1603 util/initctl.c:1693 util/initctl.c:1749
+#: util/initctl.c:1644 util/initctl.c:1734 util/initctl.c:1790
#, c-format
msgid "%s: missing job name\n"
msgstr ""
-#: util/initctl.c:1826
+#: util/initctl.c:1864 util/initctl.c:1895
+#, fuzzy, c-format
+msgid "%s: missing device name\n"
+msgstr "%s: manca un argument: %s\n"
+
+#: util/initctl.c:1928
#, c-format
msgid "%s: missing event name\n"
msgstr ""
-#: util/initctl.c:1930
+#: util/initctl.c:2032
#, fuzzy, c-format
msgid "%s: missing priority\n"
msgstr "%s: manca un argument: %s\n"
-#: util/initctl.c:1948
+#: util/initctl.c:2050
#, fuzzy, c-format
msgid "%s: invalid priority\n"
msgstr "%s: l'opció és invàlida: -%c\n"
-#: util/initctl.c:1967
+#: util/initctl.c:2069
msgid "destination process"
msgstr ""
-#: util/initctl.c:1980 util/initctl.c:1996 util/initctl.c:2012
+#: util/initctl.c:2082 util/initctl.c:2098 util/initctl.c:2114
msgid "arguments are job ids, instead of names"
msgstr ""
-#: util/initctl.c:1982 util/initctl.c:1998 util/initctl.c:2014
-#: util/initctl.c:2026 util/initctl.c:2054
+#: util/initctl.c:2084 util/initctl.c:2100 util/initctl.c:2116
+#: util/initctl.c:2128 util/initctl.c:2156
msgid "show job ids, as well as names"
msgstr ""
-#: util/initctl.c:1984
+#: util/initctl.c:2086
msgid "do not wait for job to start before exiting"
msgstr ""
-#: util/initctl.c:2000
+#: util/initctl.c:2102
msgid "do not wait for job to stop before exiting"
msgstr ""
-#: util/initctl.c:2038
+#: util/initctl.c:2140
msgid "show job and event ids, as well as names"
msgstr ""
-#: util/initctl.c:2040
+#: util/initctl.c:2142
msgid "do not wait for event to finish before exiting"
msgstr ""
-#: util/initctl.c:2042
+#: util/initctl.c:2144
msgid "set environment variable in jobs changed by this event"
msgstr ""
-#: util/initctl.c:2066
+#: util/initctl.c:2168
msgid "show event ids, as well as names"
msgstr ""
-#: util/initctl.c:2096
+#: util/initctl.c:2216
msgid "Job"
msgstr ""
-#: util/initctl.c:2103
+#: util/initctl.c:2223
msgid "Event"
msgstr ""
-#: util/initctl.c:2111 util/initctl.c:2118 util/initctl.c:2125
+#: util/initctl.c:2231 util/initctl.c:2238 util/initctl.c:2245
msgid "JOB..."
msgstr ""
-#: util/initctl.c:2112
+#: util/initctl.c:2232
msgid "Start jobs."
msgstr ""
-#: util/initctl.c:2113
+#: util/initctl.c:2233
msgid ""
"JOB is one or more job names that are to be started.\n"
"\n"
@@ -728,11 +743,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2119
+#: util/initctl.c:2239
msgid "Stop jobs."
msgstr ""
-#: util/initctl.c:2120
+#: util/initctl.c:2240
msgid ""
"JOB is one or more job names that are to be stopped.\n"
"\n"
@@ -740,11 +755,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2126
+#: util/initctl.c:2246
msgid "Query status of jobs."
msgstr ""
-#: util/initctl.c:2127
+#: util/initctl.c:2247
msgid ""
"JOB is one or more job names that are to be queried.\n"
"\n"
@@ -752,19 +767,19 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2133
+#: util/initctl.c:2253
msgid "List known jobs."
msgstr ""
-#: util/initctl.c:2137
+#: util/initctl.c:2257
msgid "EVENT [ARG]..."
msgstr ""
-#: util/initctl.c:2138
+#: util/initctl.c:2258
msgid "Emit an event."
msgstr ""
-#: util/initctl.c:2139
+#: util/initctl.c:2259
msgid ""
"EVENT is the name of an event the init daemon should emit, which may have "
"zero or more arguments specified by ARG. These may be matched in the job "
@@ -775,27 +790,35 @@
"taken from the environment or ignored if not present there."
msgstr ""
-#: util/initctl.c:2150
+#: util/initctl.c:2270
msgid "Receive notification of job state changes."
msgstr ""
-#: util/initctl.c:2155
+#: util/initctl.c:2275
msgid "Receive notification of emitted events."
msgstr ""
-#: util/initctl.c:2160
+#: util/initctl.c:2280
+msgid "Change the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2285
+msgid "Revert the last change to the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2290
msgid "Request the version of the init daemon."
msgstr ""
-#: util/initctl.c:2163
+#: util/initctl.c:2293
msgid "PRIORITY"
msgstr ""
-#: util/initctl.c:2164
+#: util/initctl.c:2294
msgid "Change the minimum priority of log messages from the init daemon"
msgstr ""
-#: util/initctl.c:2166
+#: util/initctl.c:2296
msgid ""
"PRIORITY may be one of `debug' (messages useful for debugging upstart are "
"logged, equivalent to --debug on kernel command-line); `info' (messages "
=== modified file 'po/fr.po'
--- po/fr.po 2007-10-11 21:20:43 +0000
+++ po/fr.po 2008-02-28 15:56:29 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: upstart\n"
"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
-"POT-Creation-Date: 2007-10-11 22:13+0100\n"
+"POT-Creation-Date: 2008-02-28 10:56-0500\n"
"PO-Revision-Date: 2006-10-03 23:30+0000\n"
"Last-Translator: Nicolas Velin <nsv@fr.st>\n"
"Language-Team: French <fr@li.org>\n"
@@ -22,46 +22,46 @@
msgid "display list of commands"
msgstr "afficher cette aide et quitter"
-#: nih/command.c:141
+#: nih/command.c:139
#, c-format
msgid "For a list of commands, try `%s help'."
msgstr ""
-#: nih/command.c:144
+#: nih/command.c:142
msgid "COMMAND [OPTION]... [ARG]..."
msgstr ""
-#: nih/command.c:162
+#: nih/command.c:160
#, fuzzy, c-format
msgid "%s: missing command\n"
msgstr "%s : argument manquant : %s\n"
-#: nih/command.c:170
+#: nih/command.c:168
#, fuzzy, c-format
msgid "%s: invalid command: %s\n"
msgstr "%s : option invalide : --%s\n"
-#: nih/command.c:181
+#: nih/command.c:179
#, c-format
msgid "%s [OPTION]..."
msgstr ""
-#: nih/command.c:424
+#: nih/command.c:418
#, c-format
msgid "For more information on a command, try `%s COMMAND --help'.\n"
msgstr ""
-#: nih/command.c:450
+#: nih/command.c:444
#, fuzzy, c-format
msgid "%s commands:\n"
msgstr "%s options:\n"
-#: nih/command.c:452
+#: nih/command.c:446
#, fuzzy, c-format
msgid "Other commands:\n"
msgstr "Autres options:\n"
-#: nih/command.c:454
+#: nih/command.c:448
#, c-format
msgid "Commands:\n"
msgstr ""
@@ -70,7 +70,7 @@
msgid "Unhandled Error"
msgstr "Erreur non traitée"
-#: nih/io.c:1203
+#: nih/io.c:1198
#, fuzzy
msgid "Error while reading from descriptor"
msgstr "Erreur lors de la lecture du descripteur"
@@ -106,60 +106,60 @@
msgid "output version information and exit"
msgstr "affichage de l'information de version et sortie"
-#: nih/option.c:299
+#: nih/option.c:297
#, c-format
msgid "%s: invalid option: -%c\n"
msgstr "%s: option ivalide: -%c\n"
-#: nih/option.c:392
+#: nih/option.c:390
#, c-format
msgid "%s: invalid option: --%s\n"
msgstr "%s : option invalide : --%s\n"
-#: nih/option.c:408
+#: nih/option.c:406
#, c-format
msgid "%s: unexpected argument: --%s\n"
msgstr "%s : argument inattendu : --%s\n"
-#: nih/option.c:464
+#: nih/option.c:462
#, c-format
msgid "%s: missing argument: %s\n"
msgstr "%s : argument manquant : %s\n"
-#: nih/option.c:664
+#: nih/option.c:660
#, fuzzy, c-format
msgid "%s: illegal argument: %s\n"
msgstr "%s : argument manquant : %s\n"
-#: nih/option.c:862
+#: nih/option.c:858
msgid "Usage"
msgstr "Utilisation"
-#: nih/option.c:866
+#: nih/option.c:862
msgid "[OPTION]..."
msgstr ""
-#: nih/option.c:915
+#: nih/option.c:911
#, c-format
msgid "Report bugs to <%s>\n"
msgstr "Signalez les anomalies à <%s>\n"
-#: nih/option.c:941
+#: nih/option.c:937
#, c-format
msgid "%s options:\n"
msgstr "%s options:\n"
-#: nih/option.c:943
+#: nih/option.c:939
#, c-format
msgid "Other options:\n"
msgstr "Autres options:\n"
-#: nih/option.c:945
+#: nih/option.c:941
#, c-format
msgid "Options:\n"
msgstr "Options:\n"
-#: nih/watch.c:521
+#: nih/watch.c:560
#, fuzzy
msgid "Unable to watch directory"
msgstr "Impossible d'accepter la connexion : %s"
@@ -310,82 +310,92 @@
msgid "Deleting %s job"
msgstr "Ré-éxecution de %s"
-#: init/control.c:216
+#: init/control.c:225
#, fuzzy, c-format
msgid "Error on control socket: %s"
msgstr "Erreur lors de la lecture du message de contrôle : %s"
-#: init/control.c:336
+#: init/control.c:345
+#, fuzzy
+msgid "Control request to change tty"
+msgstr "Demande de contrôle à commencer %s"
+
+#: init/control.c:379
+#, fuzzy
+msgid "Control request to revert changed tty"
+msgstr "Demande de contrôle à commencer %s"
+
+#: init/control.c:413
#, fuzzy
msgid "Control request for our version"
msgstr "Demande de contrôle pour lister les tâches"
-#: init/control.c:369
+#: init/control.c:446
#, fuzzy
msgid "Control request to change logging priority"
msgstr "Demande de contrôle à commencer %s"
-#: init/control.c:406
+#: init/control.c:483
#, fuzzy, c-format
msgid "Control request for jobs matching %s"
msgstr "Demande de contrôle de status pour %s"
-#: init/control.c:408
+#: init/control.c:485
#, fuzzy
msgid "Control request for all jobs"
msgstr "Demande de contrôle pour lister les tâches"
-#: init/control.c:470
+#: init/control.c:547
#, fuzzy, c-format
msgid "Control request for status of %s"
msgstr "Demande de contrôle de status pour %s"
-#: init/control.c:474
+#: init/control.c:551
#, fuzzy, c-format
msgid "Control request for status of job #%u"
msgstr "Demande de contrôle de status pour %s"
-#: init/control.c:528
+#: init/control.c:605
#, fuzzy, c-format
msgid "Control request to start %s"
msgstr "Demande de contrôle à commencer %s"
-#: init/control.c:532
+#: init/control.c:609
#, fuzzy, c-format
msgid "Control request to start job #%u"
msgstr "Demande de contrôle à commencer %s"
-#: init/control.c:615
+#: init/control.c:692
#, fuzzy, c-format
msgid "Control request to stop %s"
msgstr "Demande de contrôle pour arreter %s"
-#: init/control.c:619
+#: init/control.c:696
#, fuzzy, c-format
msgid "Control request to stop job #%u"
msgstr "Demande de contrôle pour arreter %s"
-#: init/control.c:748
+#: init/control.c:825
#, fuzzy, c-format
msgid "Control request to emit %s event"
msgstr "Demande de contrôle pour faire la queue des évènements %s"
-#: init/control.c:779
+#: init/control.c:856
#, fuzzy, c-format
msgid "Control request to subscribe %d to jobs"
msgstr "Demande de contrôle pour inscrire %d aux tâches"
-#: init/control.c:810
+#: init/control.c:887
#, fuzzy, c-format
msgid "Control request to unsubscribe %d from jobs"
msgstr "Demande de contrôle pour désinscrire % des tâches"
-#: init/control.c:840
+#: init/control.c:917
#, fuzzy, c-format
msgid "Control request to subscribe %d to events"
msgstr "Demande de contrôle pour inscrire %d aux évènements"
-#: init/control.c:871
+#: init/control.c:948
#, fuzzy, c-format
msgid "Control request to unsubscribe %d from events"
msgstr "Demande de contrôle pour désinscrire %d des évènements"
@@ -415,7 +425,7 @@
msgid "%s state changed from %s to %s"
msgstr "L'état de %s a été changé de %s à %s"
-#: init/job.c:817 util/initctl.c:787
+#: init/job.c:817 util/initctl.c:828
#, fuzzy, c-format
msgid "%s respawning too fast, stopped"
msgstr "Résurection de %s trop rapide, arret"
@@ -491,7 +501,7 @@
"actually run /sbin/telinit."
msgstr ""
-#: init/main.c:136 util/initctl.c:366 compat/sysv/reboot.c:203
+#: init/main.c:136 util/initctl.c:373 compat/sysv/reboot.c:203
#: compat/sysv/shutdown.c:322 compat/sysv/telinit.c:91
#, fuzzy
msgid "Need to be root"
@@ -567,175 +577,180 @@
msgid "Failed to open console: %s"
msgstr "Echec lors de l'ouverture de la console : %s"
-#: util/initctl.c:396 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
+#: util/initctl.c:403 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
#, c-format
msgid "Unable to send message: %s"
msgstr "Impossible d'envoyer le message : %s"
-#: util/initctl.c:447
+#: util/initctl.c:454
#, fuzzy, c-format
msgid "Unable to receive message: %s"
msgstr "Impossible d'envoyer le message : %s"
-#: util/initctl.c:464
+#: util/initctl.c:471
#, fuzzy, c-format
msgid "Unable to handle message: %s"
msgstr "Impossible d'envoyer le message : %s"
-#: util/initctl.c:534
+#: util/initctl.c:541
#, c-format
msgid "%s (instance)"
msgstr ""
-#: util/initctl.c:605
+#: util/initctl.c:612
#, fuzzy, c-format
msgid "%s, process %d"
msgstr "processus %s (%d) actif"
-#: util/initctl.c:607
+#: util/initctl.c:614
#, fuzzy, c-format
msgid "%s, (main) process %d"
msgstr "processus %s (%d) actif"
-#: util/initctl.c:620
+#: util/initctl.c:627
#, fuzzy, c-format
msgid "\t%s process %d"
msgstr "processus %s (%d) actif"
-#: util/initctl.c:731
+#: util/initctl.c:772
#, fuzzy, c-format
msgid "%s: goal changed"
msgstr "L'état de %s a été changé de %s à %s"
-#: util/initctl.c:793
+#: util/initctl.c:834
#, fuzzy, c-format
msgid "%s %s process killed by %s signal"
msgstr "Le processus %s (%d) a été tué par le signal %d"
-#: util/initctl.c:796
+#: util/initctl.c:837
#, fuzzy, c-format
msgid "%s %s process killed by signal %d"
msgstr "Le processus %s (%d) a été tué par le signal %d"
-#: util/initctl.c:801
+#: util/initctl.c:842
#, fuzzy, c-format
msgid "%s %s process terminated with status %d"
msgstr "le processus %s (%d) s'est terminé en retournant %d"
-#: util/initctl.c:890
+#: util/initctl.c:931
#, c-format
msgid "No jobs matching `%s'"
msgstr ""
-#: util/initctl.c:894
+#: util/initctl.c:935
msgid "No jobs registered"
msgstr ""
-#: util/initctl.c:1226
+#: util/initctl.c:1267
#, fuzzy, c-format
msgid "Unknown job: %s"
msgstr "ignore la strophe inconnue"
-#: util/initctl.c:1228
+#: util/initctl.c:1269
#, c-format
msgid "Unknown job: #%d"
msgstr ""
-#: util/initctl.c:1271
+#: util/initctl.c:1312
#, fuzzy, c-format
msgid "Invalid job: %s"
msgstr "%s : option invalide : --%s\n"
-#: util/initctl.c:1314
+#: util/initctl.c:1355
#, c-format
msgid "Job not changed: %s"
msgstr ""
-#: util/initctl.c:1462
+#: util/initctl.c:1503
#, c-format
msgid "%s event failed"
msgstr ""
-#: util/initctl.c:1581 util/initctl.c:1618 util/initctl.c:1671
-#: util/initctl.c:1708 util/initctl.c:1761
+#: util/initctl.c:1622 util/initctl.c:1659 util/initctl.c:1712
+#: util/initctl.c:1749 util/initctl.c:1802
#, fuzzy, c-format
msgid "%s: invalid job id: %s\n"
msgstr "%s : option invalide : --%s\n"
-#: util/initctl.c:1603 util/initctl.c:1693 util/initctl.c:1749
+#: util/initctl.c:1644 util/initctl.c:1734 util/initctl.c:1790
#, c-format
msgid "%s: missing job name\n"
msgstr ""
-#: util/initctl.c:1826
+#: util/initctl.c:1864 util/initctl.c:1895
+#, fuzzy, c-format
+msgid "%s: missing device name\n"
+msgstr "%s : argument manquant : %s\n"
+
+#: util/initctl.c:1928
#, c-format
msgid "%s: missing event name\n"
msgstr ""
-#: util/initctl.c:1930
+#: util/initctl.c:2032
#, fuzzy, c-format
msgid "%s: missing priority\n"
msgstr "%s : argument manquant : %s\n"
-#: util/initctl.c:1948
+#: util/initctl.c:2050
#, fuzzy, c-format
msgid "%s: invalid priority\n"
msgstr "%s: option ivalide: -%c\n"
-#: util/initctl.c:1967
+#: util/initctl.c:2069
msgid "destination process"
msgstr ""
-#: util/initctl.c:1980 util/initctl.c:1996 util/initctl.c:2012
+#: util/initctl.c:2082 util/initctl.c:2098 util/initctl.c:2114
msgid "arguments are job ids, instead of names"
msgstr ""
-#: util/initctl.c:1982 util/initctl.c:1998 util/initctl.c:2014
-#: util/initctl.c:2026 util/initctl.c:2054
+#: util/initctl.c:2084 util/initctl.c:2100 util/initctl.c:2116
+#: util/initctl.c:2128 util/initctl.c:2156
msgid "show job ids, as well as names"
msgstr ""
-#: util/initctl.c:1984
+#: util/initctl.c:2086
msgid "do not wait for job to start before exiting"
msgstr ""
-#: util/initctl.c:2000
+#: util/initctl.c:2102
msgid "do not wait for job to stop before exiting"
msgstr ""
-#: util/initctl.c:2038
+#: util/initctl.c:2140
msgid "show job and event ids, as well as names"
msgstr ""
-#: util/initctl.c:2040
+#: util/initctl.c:2142
msgid "do not wait for event to finish before exiting"
msgstr ""
-#: util/initctl.c:2042
+#: util/initctl.c:2144
msgid "set environment variable in jobs changed by this event"
msgstr ""
-#: util/initctl.c:2066
+#: util/initctl.c:2168
msgid "show event ids, as well as names"
msgstr ""
-#: util/initctl.c:2096
+#: util/initctl.c:2216
msgid "Job"
msgstr ""
-#: util/initctl.c:2103
+#: util/initctl.c:2223
msgid "Event"
msgstr ""
-#: util/initctl.c:2111 util/initctl.c:2118 util/initctl.c:2125
+#: util/initctl.c:2231 util/initctl.c:2238 util/initctl.c:2245
msgid "JOB..."
msgstr ""
-#: util/initctl.c:2112
+#: util/initctl.c:2232
msgid "Start jobs."
msgstr ""
-#: util/initctl.c:2113
+#: util/initctl.c:2233
msgid ""
"JOB is one or more job names that are to be started.\n"
"\n"
@@ -743,11 +758,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2119
+#: util/initctl.c:2239
msgid "Stop jobs."
msgstr ""
-#: util/initctl.c:2120
+#: util/initctl.c:2240
msgid ""
"JOB is one or more job names that are to be stopped.\n"
"\n"
@@ -755,11 +770,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2126
+#: util/initctl.c:2246
msgid "Query status of jobs."
msgstr ""
-#: util/initctl.c:2127
+#: util/initctl.c:2247
msgid ""
"JOB is one or more job names that are to be queried.\n"
"\n"
@@ -767,19 +782,19 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2133
+#: util/initctl.c:2253
msgid "List known jobs."
msgstr ""
-#: util/initctl.c:2137
+#: util/initctl.c:2257
msgid "EVENT [ARG]..."
msgstr ""
-#: util/initctl.c:2138
+#: util/initctl.c:2258
msgid "Emit an event."
msgstr ""
-#: util/initctl.c:2139
+#: util/initctl.c:2259
msgid ""
"EVENT is the name of an event the init daemon should emit, which may have "
"zero or more arguments specified by ARG. These may be matched in the job "
@@ -790,27 +805,35 @@
"taken from the environment or ignored if not present there."
msgstr ""
-#: util/initctl.c:2150
+#: util/initctl.c:2270
msgid "Receive notification of job state changes."
msgstr ""
-#: util/initctl.c:2155
+#: util/initctl.c:2275
msgid "Receive notification of emitted events."
msgstr ""
-#: util/initctl.c:2160
+#: util/initctl.c:2280
+msgid "Change the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2285
+msgid "Revert the last change to the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2290
msgid "Request the version of the init daemon."
msgstr ""
-#: util/initctl.c:2163
+#: util/initctl.c:2293
msgid "PRIORITY"
msgstr ""
-#: util/initctl.c:2164
+#: util/initctl.c:2294
msgid "Change the minimum priority of log messages from the init daemon"
msgstr ""
-#: util/initctl.c:2166
+#: util/initctl.c:2296
msgid ""
"PRIORITY may be one of `debug' (messages useful for debugging upstart are "
"logged, equivalent to --debug on kernel command-line); `info' (messages "
=== modified file 'po/sv.po'
--- po/sv.po 2007-10-11 21:20:43 +0000
+++ po/sv.po 2008-02-28 15:56:29 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: upstart\n"
"Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
-"POT-Creation-Date: 2007-10-11 22:13+0100\n"
+"POT-Creation-Date: 2008-02-28 10:56-0500\n"
"PO-Revision-Date: 2006-10-05 05:38+0000\n"
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
@@ -21,46 +21,46 @@
msgid "display list of commands"
msgstr ""
-#: nih/command.c:141
+#: nih/command.c:139
#, c-format
msgid "For a list of commands, try `%s help'."
msgstr ""
-#: nih/command.c:144
+#: nih/command.c:142
msgid "COMMAND [OPTION]... [ARG]..."
msgstr ""
-#: nih/command.c:162
+#: nih/command.c:160
#, c-format
msgid "%s: missing command\n"
msgstr ""
-#: nih/command.c:170
+#: nih/command.c:168
#, c-format
msgid "%s: invalid command: %s\n"
msgstr ""
-#: nih/command.c:181
+#: nih/command.c:179
#, c-format
msgid "%s [OPTION]..."
msgstr ""
-#: nih/command.c:424
+#: nih/command.c:418
#, c-format
msgid "For more information on a command, try `%s COMMAND --help'.\n"
msgstr ""
-#: nih/command.c:450
+#: nih/command.c:444
#, c-format
msgid "%s commands:\n"
msgstr ""
-#: nih/command.c:452
+#: nih/command.c:446
#, c-format
msgid "Other commands:\n"
msgstr ""
-#: nih/command.c:454
+#: nih/command.c:448
#, c-format
msgid "Commands:\n"
msgstr ""
@@ -69,7 +69,7 @@
msgid "Unhandled Error"
msgstr ""
-#: nih/io.c:1203
+#: nih/io.c:1198
msgid "Error while reading from descriptor"
msgstr ""
@@ -100,60 +100,60 @@
msgid "output version information and exit"
msgstr ""
-#: nih/option.c:299
+#: nih/option.c:297
#, c-format
msgid "%s: invalid option: -%c\n"
msgstr ""
-#: nih/option.c:392
+#: nih/option.c:390
#, c-format
msgid "%s: invalid option: --%s\n"
msgstr ""
-#: nih/option.c:408
+#: nih/option.c:406
#, c-format
msgid "%s: unexpected argument: --%s\n"
msgstr ""
-#: nih/option.c:464
+#: nih/option.c:462
#, c-format
msgid "%s: missing argument: %s\n"
msgstr ""
-#: nih/option.c:664
+#: nih/option.c:660
#, c-format
msgid "%s: illegal argument: %s\n"
msgstr ""
+#: nih/option.c:858
+msgid "Usage"
+msgstr ""
+
#: nih/option.c:862
-msgid "Usage"
-msgstr ""
-
-#: nih/option.c:866
msgid "[OPTION]..."
msgstr ""
-#: nih/option.c:915
+#: nih/option.c:911
#, c-format
msgid "Report bugs to <%s>\n"
msgstr ""
-#: nih/option.c:941
+#: nih/option.c:937
#, c-format
msgid "%s options:\n"
msgstr ""
-#: nih/option.c:943
+#: nih/option.c:939
#, c-format
msgid "Other options:\n"
msgstr ""
-#: nih/option.c:945
+#: nih/option.c:941
#, c-format
msgid "Options:\n"
msgstr ""
-#: nih/watch.c:521
+#: nih/watch.c:560
msgid "Unable to watch directory"
msgstr ""
@@ -291,79 +291,87 @@
msgid "Deleting %s job"
msgstr ""
-#: init/control.c:216
+#: init/control.c:225
#, c-format
msgid "Error on control socket: %s"
msgstr ""
-#: init/control.c:336
+#: init/control.c:345
+msgid "Control request to change tty"
+msgstr ""
+
+#: init/control.c:379
+msgid "Control request to revert changed tty"
+msgstr ""
+
+#: init/control.c:413
msgid "Control request for our version"
msgstr ""
-#: init/control.c:369
+#: init/control.c:446
msgid "Control request to change logging priority"
msgstr ""
-#: init/control.c:406
+#: init/control.c:483
#, c-format
msgid "Control request for jobs matching %s"
msgstr ""
-#: init/control.c:408
+#: init/control.c:485
msgid "Control request for all jobs"
msgstr ""
-#: init/control.c:470
+#: init/control.c:547
#, c-format
msgid "Control request for status of %s"
msgstr ""
-#: init/control.c:474
+#: init/control.c:551
#, c-format
msgid "Control request for status of job #%u"
msgstr ""
-#: init/control.c:528
+#: init/control.c:605
#, c-format
msgid "Control request to start %s"
msgstr ""
-#: init/control.c:532
+#: init/control.c:609
#, c-format
msgid "Control request to start job #%u"
msgstr ""
-#: init/control.c:615
+#: init/control.c:692
#, c-format
msgid "Control request to stop %s"
msgstr ""
-#: init/control.c:619
+#: init/control.c:696
#, c-format
msgid "Control request to stop job #%u"
msgstr ""
-#: init/control.c:748
+#: init/control.c:825
#, c-format
msgid "Control request to emit %s event"
msgstr ""
-#: init/control.c:779
+#: init/control.c:856
#, c-format
msgid "Control request to subscribe %d to jobs"
msgstr ""
-#: init/control.c:810
+#: init/control.c:887
#, c-format
msgid "Control request to unsubscribe %d from jobs"
msgstr ""
-#: init/control.c:840
+#: init/control.c:917
#, c-format
msgid "Control request to subscribe %d to events"
msgstr ""
-#: init/control.c:871
+#: init/control.c:948
#, c-format
msgid "Control request to unsubscribe %d from events"
msgstr ""
@@ -393,7 +401,7 @@
msgid "%s state changed from %s to %s"
msgstr ""
-#: init/job.c:817 util/initctl.c:787
+#: init/job.c:817 util/initctl.c:828
#, c-format
msgid "%s respawning too fast, stopped"
msgstr ""
@@ -468,7 +476,7 @@
"actually run /sbin/telinit."
msgstr ""
-#: init/main.c:136 util/initctl.c:366 compat/sysv/reboot.c:203
+#: init/main.c:136 util/initctl.c:373 compat/sysv/reboot.c:203
#: compat/sysv/shutdown.c:322 compat/sysv/telinit.c:91
msgid "Need to be root"
msgstr ""
@@ -538,175 +546,180 @@
msgid "Failed to open console: %s"
msgstr ""
-#: util/initctl.c:396 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
+#: util/initctl.c:403 compat/sysv/shutdown.c:513 compat/sysv/telinit.c:138
#, c-format
msgid "Unable to send message: %s"
msgstr ""
-#: util/initctl.c:447
+#: util/initctl.c:454
#, c-format
msgid "Unable to receive message: %s"
msgstr ""
-#: util/initctl.c:464
+#: util/initctl.c:471
#, c-format
msgid "Unable to handle message: %s"
msgstr ""
-#: util/initctl.c:534
+#: util/initctl.c:541
#, c-format
msgid "%s (instance)"
msgstr ""
-#: util/initctl.c:605
+#: util/initctl.c:612
#, c-format
msgid "%s, process %d"
msgstr ""
-#: util/initctl.c:607
+#: util/initctl.c:614
#, c-format
msgid "%s, (main) process %d"
msgstr ""
-#: util/initctl.c:620
+#: util/initctl.c:627
#, c-format
msgid "\t%s process %d"
msgstr ""
-#: util/initctl.c:731
+#: util/initctl.c:772
#, c-format
msgid "%s: goal changed"
msgstr ""
-#: util/initctl.c:793
+#: util/initctl.c:834
#, c-format
msgid "%s %s process killed by %s signal"
msgstr ""
-#: util/initctl.c:796
+#: util/initctl.c:837
#, c-format
msgid "%s %s process killed by signal %d"
msgstr ""
-#: util/initctl.c:801
+#: util/initctl.c:842
#, c-format
msgid "%s %s process terminated with status %d"
msgstr ""
-#: util/initctl.c:890
+#: util/initctl.c:931
#, c-format
msgid "No jobs matching `%s'"
msgstr ""
-#: util/initctl.c:894
+#: util/initctl.c:935
msgid "No jobs registered"
msgstr ""
-#: util/initctl.c:1226
+#: util/initctl.c:1267
#, c-format
msgid "Unknown job: %s"
msgstr ""
-#: util/initctl.c:1228
+#: util/initctl.c:1269
#, c-format
msgid "Unknown job: #%d"
msgstr ""
-#: util/initctl.c:1271
+#: util/initctl.c:1312
#, c-format
msgid "Invalid job: %s"
msgstr ""
-#: util/initctl.c:1314
+#: util/initctl.c:1355
#, c-format
msgid "Job not changed: %s"
msgstr ""
-#: util/initctl.c:1462
+#: util/initctl.c:1503
#, c-format
msgid "%s event failed"
msgstr ""
-#: util/initctl.c:1581 util/initctl.c:1618 util/initctl.c:1671
-#: util/initctl.c:1708 util/initctl.c:1761
+#: util/initctl.c:1622 util/initctl.c:1659 util/initctl.c:1712
+#: util/initctl.c:1749 util/initctl.c:1802
#, c-format
msgid "%s: invalid job id: %s\n"
msgstr ""
-#: util/initctl.c:1603 util/initctl.c:1693 util/initctl.c:1749
+#: util/initctl.c:1644 util/initctl.c:1734 util/initctl.c:1790
#, c-format
msgid "%s: missing job name\n"
msgstr ""
-#: util/initctl.c:1826
+#: util/initctl.c:1864 util/initctl.c:1895
+#, c-format
+msgid "%s: missing device name\n"
+msgstr ""
+
+#: util/initctl.c:1928
#, c-format
msgid "%s: missing event name\n"
msgstr ""
-#: util/initctl.c:1930
+#: util/initctl.c:2032
#, c-format
msgid "%s: missing priority\n"
msgstr ""
-#: util/initctl.c:1948
+#: util/initctl.c:2050
#, c-format
msgid "%s: invalid priority\n"
msgstr ""
-#: util/initctl.c:1967
+#: util/initctl.c:2069
msgid "destination process"
msgstr ""
-#: util/initctl.c:1980 util/initctl.c:1996 util/initctl.c:2012
+#: util/initctl.c:2082 util/initctl.c:2098 util/initctl.c:2114
msgid "arguments are job ids, instead of names"
msgstr ""
-#: util/initctl.c:1982 util/initctl.c:1998 util/initctl.c:2014
-#: util/initctl.c:2026 util/initctl.c:2054
+#: util/initctl.c:2084 util/initctl.c:2100 util/initctl.c:2116
+#: util/initctl.c:2128 util/initctl.c:2156
msgid "show job ids, as well as names"
msgstr ""
-#: util/initctl.c:1984
+#: util/initctl.c:2086
msgid "do not wait for job to start before exiting"
msgstr ""
-#: util/initctl.c:2000
+#: util/initctl.c:2102
msgid "do not wait for job to stop before exiting"
msgstr ""
-#: util/initctl.c:2038
+#: util/initctl.c:2140
msgid "show job and event ids, as well as names"
msgstr ""
-#: util/initctl.c:2040
+#: util/initctl.c:2142
msgid "do not wait for event to finish before exiting"
msgstr ""
-#: util/initctl.c:2042
+#: util/initctl.c:2144
msgid "set environment variable in jobs changed by this event"
msgstr ""
-#: util/initctl.c:2066
+#: util/initctl.c:2168
msgid "show event ids, as well as names"
msgstr ""
-#: util/initctl.c:2096
+#: util/initctl.c:2216
msgid "Job"
msgstr ""
-#: util/initctl.c:2103
+#: util/initctl.c:2223
msgid "Event"
msgstr ""
-#: util/initctl.c:2111 util/initctl.c:2118 util/initctl.c:2125
+#: util/initctl.c:2231 util/initctl.c:2238 util/initctl.c:2245
msgid "JOB..."
msgstr ""
-#: util/initctl.c:2112
+#: util/initctl.c:2232
msgid "Start jobs."
msgstr ""
-#: util/initctl.c:2113
+#: util/initctl.c:2233
msgid ""
"JOB is one or more job names that are to be started.\n"
"\n"
@@ -714,11 +727,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2119
+#: util/initctl.c:2239
msgid "Stop jobs."
msgstr ""
-#: util/initctl.c:2120
+#: util/initctl.c:2240
msgid ""
"JOB is one or more job names that are to be stopped.\n"
"\n"
@@ -726,11 +739,11 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2126
+#: util/initctl.c:2246
msgid "Query status of jobs."
msgstr ""
-#: util/initctl.c:2127
+#: util/initctl.c:2247
msgid ""
"JOB is one or more job names that are to be queried.\n"
"\n"
@@ -738,19 +751,19 @@
"uniquely identifying a particular instance of a job."
msgstr ""
-#: util/initctl.c:2133
+#: util/initctl.c:2253
msgid "List known jobs."
msgstr ""
-#: util/initctl.c:2137
+#: util/initctl.c:2257
msgid "EVENT [ARG]..."
msgstr ""
-#: util/initctl.c:2138
+#: util/initctl.c:2258
msgid "Emit an event."
msgstr ""
-#: util/initctl.c:2139
+#: util/initctl.c:2259
msgid ""
"EVENT is the name of an event the init daemon should emit, which may have "
"zero or more arguments specified by ARG. These may be matched in the job "
@@ -761,27 +774,35 @@
"taken from the environment or ignored if not present there."
msgstr ""
-#: util/initctl.c:2150
+#: util/initctl.c:2270
msgid "Receive notification of job state changes."
msgstr ""
-#: util/initctl.c:2155
+#: util/initctl.c:2275
msgid "Receive notification of emitted events."
msgstr ""
-#: util/initctl.c:2160
+#: util/initctl.c:2280
+msgid "Change the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2285
+msgid "Revert the last change to the init daemon's tty device"
+msgstr ""
+
+#: util/initctl.c:2290
msgid "Request the version of the init daemon."
msgstr ""
-#: util/initctl.c:2163
+#: util/initctl.c:2293
msgid "PRIORITY"
msgstr ""
-#: util/initctl.c:2164
+#: util/initctl.c:2294
msgid "Change the minimum priority of log messages from the init daemon"
msgstr ""
-#: util/initctl.c:2166
+#: util/initctl.c:2296
msgid ""
"PRIORITY may be one of `debug' (messages useful for debugging upstart are "
"logged, equivalent to --debug on kernel command-line); `info' (messages "
=== modified file 'upstart/message.c'
--- upstart/message.c 2007-03-16 17:18:00 +0000
+++ upstart/message.c 2008-02-29 03:13:11 +0000
@@ -261,6 +261,20 @@
break;
case UPSTART_VERSION_QUERY:
break;
+ case UPSTART_POP_TTY:
+ break;
+ case UPSTART_TTY:
+ if (upstart_push_packv (message, "s", args_copy))
+ goto error;
+
+ break;
+
+ case UPSTART_PUSH_TTY:
+ if (upstart_push_packv (message, "s", args_copy))
+ goto error;
+
+ break;
+
case UPSTART_LOG_PRIORITY:
if (upstart_push_packv (message, "u", args_copy))
goto error;
@@ -550,6 +564,9 @@
case UPSTART_VERSION_QUERY:
ret = handler (data, cred.pid, type);
break;
+ case UPSTART_POP_TTY:
+ ret = handler (data, cred.pid, type);
+ break;
case UPSTART_LOG_PRIORITY: {
NihLogLevel priority;
@@ -559,6 +576,41 @@
ret = handler (data, cred.pid, type, priority);
break;
}
+
+ case UPSTART_PUSH_TTY: {
+ char *tty = NULL;
+
+ if (upstart_pop_pack (message, parent, "s", &tty)) {
+ if (tty)
+ nih_free (tty);
+
+ goto invalid;
+ }
+
+ if (! tty)
+ goto invalid;
+
+ ret = handler (data, cred.pid, type, tty);
+ break;
+ }
+
+ case UPSTART_TTY: {
+ char *tty = NULL;
+
+ if (upstart_pop_pack (message, parent, "s", &tty)) {
+ if (tty)
+ nih_free (tty);
+
+ goto invalid;
+ }
+
+ if (! tty)
+ goto invalid;
+
+ ret = handler (data, cred.pid, type, tty);
+ break;
+ }
+
case UPSTART_VERSION: {
char *version = NULL;
=== modified file 'upstart/message.h'
--- upstart/message.h 2007-03-13 17:27:09 +0000
+++ upstart/message.h 2008-02-28 04:52:36 +0000
@@ -57,11 +57,20 @@
* UPSTART_VERSION message in reply.
*
* Clients may send UPSTART_LOG_PRIORITY, without any reply.
+ *
+ * Clients may send UPSTART_PUSH_TTY and recieve an UPSTART_TTY message
+ * in reply
+ *
+ * Clients may send UPSTART_POP_TTY and recieve an UPSTART_TTY message
+ * in reply
*/
UPSTART_NO_OP = 0x0000,
UPSTART_VERSION_QUERY = 0x0001,
UPSTART_LOG_PRIORITY = 0x0002,
UPSTART_VERSION = 0x0010,
+ UPSTART_PUSH_TTY = 0x0011,
+ UPSTART_POP_TTY = 0x0012,
+ UPSTART_TTY = 0x0013,
/* Job requests and responses.
*
=== modified file 'util/initctl.c'
--- util/initctl.c 2007-03-13 18:08:31 +0000
+++ util/initctl.c 2008-03-02 21:05:23 +0000
@@ -99,6 +99,9 @@
static char *output_name (unsigned int id, const char *name);
/* Prototypes of response handler functions */
+static int handle_tty (void *data, pid_t pid,
+ UpstartMessageType type,
+ const char *tty);
static int handle_version (void *data, pid_t pid,
UpstartMessageType type,
const char *version);
@@ -159,6 +162,8 @@
/* Prototypes for option and command functions */
int env_option (NihOption *option, const char *arg);
+int push_tty_action (NihCommand *command, char * const *args);
+int pop_tty_action (NihCommand *command, char * const *args);
int start_action (NihCommand *command, char * const *args);
int stop_action (NihCommand *command, char * const *args);
int status_action (NihCommand *command, char * const *args);
@@ -296,6 +301,8 @@
{ -1, UPSTART_VERSION,
(UpstartMessageHandler)handle_version },
+ { -1, UPSTART_TTY,
+ (UpstartMessageHandler)handle_tty },
{ -1, UPSTART_JOB,
(UpstartMessageHandler)handle_job },
{ -1, UPSTART_JOB_FINISHED,
@@ -687,6 +694,40 @@
}
/**
+ * handle_tty:
+ * @data: data passed to handler,
+ * @pid: origin of message,
+ * @type: message type,
+ * @version: tty device in use.
+ *
+ * Handles receipt of the UPSTART_TTY reply from the server, which is
+ * sent in response to an UPSTART_PUSH_TTY or UPSTART_POP_TTY message.
+ *
+ * Output the version string received and mark it as a response.
+ *
+ * Returns: zero on success, negative value on error or positive value if the
+ * command should exit with that exit status.
+ **/
+static int
+handle_tty (void *data,
+ pid_t pid,
+ UpstartMessageType type,
+ const char *tty)
+{
+ nih_assert (pid > 0);
+ nih_assert (type == UPSTART_TTY);
+ nih_assert (tty != NULL);
+
+ if (! event_caused)
+ num_responses++;
+
+ event_caused = FALSE;
+
+ nih_message ("%s", tty);
+
+ return 0;
+}
+/**
* handle_job:
* @data: data passed to handler,
* @pid: origin of message,
@@ -1802,6 +1843,61 @@
}
/**
+ * pop_tty_action:
+ * @command: NihCommand invoked,
+ * @args: command-line arguments.
+ *
+ * This function is called for the "pop_tty" command; it takes no arguments.
+ *
+ * It reverts the last push_tty command, and replies with the new tty.
+ *
+ * Returns: command exit status.
+ **/
+int
+pop_tty_action (NihCommand *command,
+ char * const *args)
+{
+ nih_assert (command != NULL);
+ nih_assert (args != NULL);
+
+ if (initctl_send (UPSTART_POP_TTY) < 0)
+ return 1;
+
+ return initctl_recv (1);
+}
+
+/**
+ * push_tty_action:
+ * @command: NihCommand invoked,
+ * @args: command-line arguments.
+ *
+ * This function is called for the "push_tty" command; it takes a tty device
+ * name.
+ *
+ * It causes upstart to begin using that tty, and replies with the new tty.
+ *
+ * Returns: command exit status.
+ **/
+int
+push_tty_action (NihCommand *command,
+ char * const *args)
+{
+ nih_assert (command != NULL);
+ nih_assert (args != NULL);
+
+ if (! args[0]) {
+ fprintf (stderr, _("%s: missing device name\n"), program_name);
+ nih_main_suggest_help ();
+ return 1;
+ }
+
+ if (initctl_send (UPSTART_PUSH_TTY, args[0]) < 0)
+ return 1;
+
+ return initctl_recv (1);
+}
+
+/**
* emit_action:
* @command: NihCommand invoked,
* @args: command-line arguments.
@@ -2079,6 +2175,24 @@
};
/**
+ * pop_tty_options:
+ *
+ * Command-line options accepted for the pop_tty command.
+ **/
+NihOption pop_tty_options[] = {
+ NIH_OPTION_LAST
+};
+
+/**
+ * push_tty_options:
+ *
+ * Command-line options accepted for the push_tty command.
+ **/
+NihOption push_tty_options[] = {
+ NIH_OPTION_LAST
+};
+
+/**
* log_priority_options:
*
* Command-line options accepted for the log-priority command.
@@ -2156,6 +2270,16 @@
NULL,
&event_commands, events_options, events_action },
+ { "push-tty", NULL,
+ N_("Change the init daemon's tty device"),
+ NULL,
+ NULL, push_tty_options, push_tty_action },
+
+ { "pop-tty", NULL,
+ N_("Revert the last change to the init daemon's tty device"),
+ NULL,
+ NULL, pop_tty_options, pop_tty_action },
+
{ "version", NULL,
N_("Request the version of the init daemon."),
NULL,