<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.27 2004/05/27 03:50:25 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.28 2004/06/04 04:05:36 momjian Exp $
PostgreSQL documentation
-->
<para>
<option>kill</option> mode allows you to send a signal to a specified
process. This is particularly valuable for <productname>MS Windows</>
- which does not have a <application>kill</> command.
+ which does not have a <application>kill</> command. Use
+ <literal>--help</> to see a list of supported signal names.
</para>
</refsect1>
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.6 2004/06/03 00:07:36 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.7 2004/06/04 04:05:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
printf(_("Options for stop or restart:\n"));
printf(_(" -m SHUTDOWN-MODE may be 'smart', 'fast', or 'immediate'\n\n"));
printf(_("Allowed signal names for kill:\n"));
- printf(_(" -HUP -INT -QUIT -ABRT -TERM -USR1 -USR2\n\n"));
+ printf(_(" HUP INT QUIT ABRT TERM USR1 USR2\n\n"));
printf(_("Shutdown modes are:\n"));
printf(_(" smart quit after all clients have disconnected\n"));
printf(_(" fast quit directly, with proper shutdown\n"));
static void
set_sig(char *signame)
{
- if (!strcmp(signame, "-HUP"))
+ if (!strcmp(signame, "HUP"))
sig = SIGHUP;
- else if (!strcmp(signame, "-INT"))
+ else if (!strcmp(signame, "INT"))
sig = SIGINT;
- else if (!strcmp(signame, "-QUIT"))
+ else if (!strcmp(signame, "QUIT"))
sig = SIGQUIT;
- else if (!strcmp(signame, "-ABRT"))
+ else if (!strcmp(signame, "ABRT"))
sig = SIGABRT;
/*
* probably should NOT provide SIGKILL
*
- * else if (!strcmp(signame,"-KILL")) sig = SIGKILL;
+ * else if (!strcmp(signame,"KILL")) sig = SIGKILL;
*/
- else if (!strcmp(signame, "-TERM"))
+ else if (!strcmp(signame, "TERM"))
sig = SIGTERM;
- else if (!strcmp(signame, "-USR1"))
+ else if (!strcmp(signame, "USR1"))
sig = SIGUSR1;
- else if (!strcmp(signame, "-USR2"))
+ else if (!strcmp(signame, "USR2"))
sig = SIGUSR2;
else
{
exit(1);
}
ctl_command = KILL_COMMAND;
- set_sig(argv[optind + 1]);
- killproc = atol(argv[optind + 2]);
+ set_sig(argv[++optind]);
+ killproc = atol(argv[++optind]);
}
else
{