FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CRUX > CRUX

 
 
LinkBack Thread Tools
 
Old 02-17-2008, 07:23 PM
Clemens Koller
 
Default Problem with reloading / SIGHUP some services

Hi there!

I just realized that i.e. dovecot and exim /etc/rc.d start/stop scripts'
reload function doesn't work over here on CRUX-2.4, bash 3.2.33(1).

I had to use the /bin/kill binary, otherwise, I get:

$ ./exim reload
./exim: line 19: kill: SIGHUP: invalid signal specification

My bash's internal `kill` doesn't seem to recognize SIGHUP.
Can you please verify?! The following patches work around the
problem, but I want to understand whether this behaviour is
expected or erratic.

Thank you!

Clemens


--
$ diff -Nurp /etc/rc.d/dovecot~ /etc/rc.d/dovecot
--- /etc/rc.d/dovecot~ 2008-01-03 23:02:03.000000000 +0100
+++ /etc/rc.d/dovecot 2008-02-17 21:10:53.000000000 +0100
@@ -22,7 +22,7 @@ restart)
$0 start
;;
reload)
- kill -s SIGHUP $(pidof dovecot)
+ /bin/kill -s SIGHUP $(pidof dovecot)
;;
*)
echo "usage: $0 [start|stop|restart|reload]"



$ diff -Nurp /etc/rc.d/exim~ /etc/rc.d/exim
--- /etc/rc.d/exim~ 2008-02-17 21:09:24.000000000 +0100
+++ /etc/rc.d/exim 2008-02-17 21:10:17.000000000 +0100
@@ -16,7 +16,7 @@ restart)
$0 start
;;
reload)
- kill -s SIGHUP `pidof exim`
+ /bin/kill -s SIGHUP `pidof exim`
;;
*)
echo "usage: $0 [start|stop|restart|reload]"
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 02-17-2008, 07:48 PM
Alan Mizrahi
 
Default Problem with reloading / SIGHUP some services

El Dom 17 Feb 2008, Clemens Koller escribió:
> Hi there!
>
> I just realized that i.e. dovecot and exim /etc/rc.d start/stop scripts'
> reload function doesn't work over here on CRUX-2.4, bash 3.2.33(1).
>
> I had to use the /bin/kill binary, otherwise, I get:
>
> $ ./exim reload
> ./exim: line 19: kill: SIGHUP: invalid signal specification
>
> My bash's internal `kill` doesn't seem to recognize SIGHUP.
> Can you please verify?! The following patches work around the
> problem, but I want to understand whether this behaviour is
> expected or erratic.


You are not using bash, bash's builtin kill does accept SIGHUP.
There are many scripts in CRUX that need this kind of correction, scripts that
use #!/bin/sh should not use bash specific features.

--
Alan
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 02-17-2008, 08:41 PM
Clemens Koller
 
Default Problem with reloading / SIGHUP some services

Alan Mizrahi schrieb:
> El Dom 17 Feb 2008, Clemens Koller escribió:
>> Hi there!
>>
>> I just realized that i.e. dovecot and exim /etc/rc.d start/stop scripts'
>> reload function doesn't work over here on CRUX-2.4, bash 3.2.33(1).
>>
>> I had to use the /bin/kill binary, otherwise, I get:
>>
>> $ ./exim reload
>> ./exim: line 19: kill: SIGHUP: invalid signal specification
>>
>> My bash's internal `kill` doesn't seem to recognize SIGHUP.
>> Can you please verify?! The following patches work around the
>> problem, but I want to understand whether this behaviour is
>> expected or erratic.
>
>
> You are not using bash, bash's builtin kill does accept SIGHUP.

Well, good hint, but I don't think so:

$ which sh
/bin/sh

$ ls -la /bin/sh
lrwxrwxrwx 1 root root 4 Jan 4 20:57 /bin/sh -> bash

$ /bin/sh --version
GNU bash, version 3.2.33(1)-release (i686-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.

> There are many scripts in CRUX that need this kind of correction, scripts that
> use #!/bin/sh should not use bash specific features.

Ack. But I still can't see how I am _not_ using bash in above scripts.
Is bash turning on some "sh" compatibility mode triggered by #!/bin/sh which
can lead to the mentioned symptom? Am I blind?

Regards,

Clemens

_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 02-18-2008, 07:22 AM
Juergen Daubert
 
Default Problem with reloading / SIGHUP some services

On Sun, Feb 17, 2008 at 10:41:12PM +0100, Clemens Koller wrote:
> Alan Mizrahi schrieb:
> > El Dom 17 Feb 2008, Clemens Koller escribió:
> >> Hi there!
> >>
> >> I just realized that i.e. dovecot and exim /etc/rc.d start/stop scripts'
> >> reload function doesn't work over here on CRUX-2.4, bash 3.2.33(1).
> >>
> >> I had to use the /bin/kill binary, otherwise, I get:
> >>
> >> $ ./exim reload
> >> ./exim: line 19: kill: SIGHUP: invalid signal specification
> >>
> >> My bash's internal `kill` doesn't seem to recognize SIGHUP.
> >> Can you please verify?! The following patches work around the
> >> problem, but I want to understand whether this behaviour is
> >> expected or erratic.
> >
> >
> > You are not using bash, bash's builtin kill does accept SIGHUP.
>
> Well, good hint, but I don't think so:
>
> $ which sh
> /bin/sh
>
> $ ls -la /bin/sh
> lrwxrwxrwx 1 root root 4 Jan 4 20:57 /bin/sh -> bash
>
> $ /bin/sh --version
> GNU bash, version 3.2.33(1)-release (i686-pc-linux-gnu)
> Copyright (C) 2007 Free Software Foundation, Inc.
>
> > There are many scripts in CRUX that need this kind of correction, scripts that
> > use #!/bin/sh should not use bash specific features.
>
> Ack. But I still can't see how I am _not_ using bash in above scripts.
> Is bash turning on some "sh" compatibility mode triggered by #!/bin/sh which
> can lead to the mentioned symptom? Am I blind?

Yes and no. Bash called as sh runs in POSIX mode. The simple fix is
to replace SIGHUP with HUP in the rc scripts. Run kill -l in a bash
and sh to see the difference.

Greetings
Juergen


--
Juergen Daubert | mailto:jue@jue.li
Korb, Germany | http://jue.li/crux

_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 

Thread Tools




All times are GMT. The time now is 11:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org