make bopm restartable by signal
Robbert Muller <[email protected]>
| Newsgroups | gmane.network.irc.bopm |
|---|---|
| Message-ID | <[email protected]> |
i have bopm is running as user bopm, but needs to be started from root to set the ulimits. so the problem what i had was restarting bopm from a shell on config changes. i added the following patch to be able to restart bopm from a shell as user bopm. regards Robbert PS i'm not on the list, so keeping me in the cc list whould be nice -- Robbert Muller | Never let a luser on your console. spam(dot)me(at)grols(dot)ch | Because that means they're in your room. uin: 9659330 | PGP-key 0x2F634245
sigusr2.patch
(text/plain, 831 B)
--- main.c 2003-06-22 15:19:39.000000000 +0200
+++ main-new.c 2004-09-22 16:42:47.000000000 +0200
@@ -72,6 +72,7 @@
struct sigaction ALARMACTION;
struct sigaction INTACTION;
struct sigaction USR1ACTION;
+struct sigaction USR2ACTION;
int main(int argc, char **argv)
{
@@ -184,10 +185,12 @@
ALARMACTION.sa_flags = SA_RESTART;
INTACTION.sa_handler = &(do_signal);
USR1ACTION.sa_handler = &(do_signal);
+ USR2ACTION.sa_handler = &(do_signal);
sigaction(SIGALRM, &ALARMACTION, 0);
sigaction(SIGINT, &INTACTION, 0);
sigaction(SIGUSR1, &USR1ACTION, 0);
+ sigaction(SIGUSR2, &USR2ACTION, 0);
/* Ignore SIGPIPE. */
signal(SIGPIPE, SIG_IGN);
@@ -286,6 +289,9 @@
case SIGUSR1:
REOPEN = 1;
break;
+ case SIGUSR2:
+ RESTART = 1;
+ break;
}
}
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBVq6x3twlWS9jQkURAn0lAJ4/Egqwg1k7cvciDXOsVxJL9zLrEQCfbbmn q67nC21waRfaARWa1O5tyoY= =dKHM -----END PGP SIGNATURE-----