Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
'Reload' function for init scripts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  

Should all Gentoo init scripts have a 'reload' function to re-read the daemon's configuration without interupting the service?
Yes!
100%
 100%  [ 20 ]
No!
0%
 0%  [ 0 ]
I don't need this.
0%
 0%  [ 0 ]
Total Votes : 20

Author Message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Mon Apr 25, 2005 3:29 pm    Post subject: 'Reload' function for init scripts Reply with quote

One thing I'm *really* missing in Gentoo is this nice 'reload' function that (almost) all Debian init scripts have. I have two servers, one Gentoo and one Debian, and it's really nice if I can just start '/etc/init.d/apache2 reload' or '/etc/init.d/jabber reload' to re-read the config file instead of having to do this manually. I know I can do this by sending SIGHUB to the daemon, but it doesn't work for all daemons and it's way easier to do this via an init script. Also, the 'restart' function has the same effect, but it stops and starts the daemon, which is really not very nice if you do this with sshd on a remote machine, like it happened to me once :oops:

I think it should not be much of a problem to add such a function to all the init scripts for the daemons that support it. This is somethng I'm really missing, so I'm voting for inclusion into the Gentoo baselayout!!


Tom
Back to top
View user's profile Send private message
spb
Retired Dev
Retired Dev


Joined: 02 Jan 2004
Posts: 2135
Location: Cambridge, UK

PostPosted: Mon Apr 25, 2005 3:32 pm    Post subject: Reply with quote

Sounds like something that could be implemented .... file a bug at https://bugs.gentoo.org if you want to see it.
Back to top
View user's profile Send private message
fourhead
l33t
l33t


Joined: 03 Sep 2003
Posts: 875
Location: Cologne, Germany

PostPosted: Tue Apr 26, 2005 11:55 pm    Post subject: Reply with quote

Well I filed a bug report for this, I already got an answer that wasn't too positive, I was told that such a thing would be the decision of every single package maintainer. I hoped someone could make this a common suggestion/guideline for init scripts :-(


Tom
Back to top
View user's profile Send private message
ssbilly5
n00b
n00b


Joined: 01 Sep 2002
Posts: 46
Location: USA

PostPosted: Wed Apr 27, 2005 4:22 am    Post subject: Reply with quote

I've always used
Code:
 /etc/init.d/apache2 restart

Does this not do what you're asking? I believe it also works for almost every other script in init.d as well.
Maybe I'm missing something, but I hope this helps


John
Back to top
View user's profile Send private message
zxiiro
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 98
Location: Ottawa

PostPosted: Wed Apr 27, 2005 4:32 am    Post subject: Reply with quote

ssbilly5 wrote:
I've always used
Code:
 /etc/init.d/apache2 restart

Does this not do what you're asking? I believe it also works for almost every other script in init.d as well.
Maybe I'm missing something, but I hope this helps


John


actually that stops the service and turns it back on. the idea is to do this without stopping the service.
Back to top
View user's profile Send private message
gentoo_lan
l33t
l33t


Joined: 08 Sep 2004
Posts: 891
Location: Charles Town, WV

PostPosted: Wed Apr 27, 2005 6:28 am    Post subject: Reply with quote

elektrohirn wrote:
Well I filed a bug report for this, I already got an answer that wasn't too positive, I was told that such a thing would be the decision of every single package maintainer. I hoped someone could make this a common suggestion/guideline for init scripts :-(


Tom


What is the bug number?
Back to top
View user's profile Send private message
nevynxxx
Veteran
Veteran


Joined: 12 Nov 2003
Posts: 1123
Location: Manchester - UK

PostPosted: Wed Apr 27, 2005 6:40 am    Post subject: Reply with quote

elektrohirn wrote:
Well I filed a bug report for this, I already got an answer that wasn't too positive, I was told that such a thing would be the decision of every single package maintainer. I hoped someone could make this a common suggestion/guideline for init scripts :-(


Tom


Well it would, it would be a big job to go through all the packages that create init scripts and change them, but the package maintainers can do it easily.

There isn't really any sane way of forcing them to adopt this, but it would be a good thing for them to do. If they feel kind.
_________________
My Public Key

Wanted: Instructor in the art of Bowyery
Back to top
View user's profile Send private message
castorilo
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 157

PostPosted: Wed Apr 27, 2005 1:09 pm    Post subject: Reply with quote

I must be missing something. This works perfectly for me and I have been using it for a while:

Code:

# cd /etc/init.d
init.d # ./apache2 reload
 * Reloading apache2...                                                                                        [ ok ]


and if you take a look at the apache2 script, you can see the reload function does a graceful restart (apache's way to do what you describe).

Every package does a reload a little different. Some do a SIGHUP, others (like apache) do a -graceful, and some don't do it. There is no way to do a generic way for everyone, fortunatelly, most common daemons have it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum