Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can we add a new init.d state refresh
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Gentoo Server
Apprentice
Apprentice


Joined: 21 Jul 2003
Posts: 279

PostPosted: Wed Apr 06, 2005 9:20 am    Post subject: can we add a new init.d state refresh Reply with quote

sometimes you change a config and want to restart demon or reload config
on way is to restart maybe better way is to HUP

example
kill -HUP `pidof mysqld`

what do you think if we make something like /etc/init.d/mysql update to reload config files?
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Wed Apr 06, 2005 9:55 am    Post subject: Reply with quote

I think the majority of init scripts would not be able to support something like that. You can however change the mysql init script to have this feature. Just add a line
Code:
opts="${opts} reload"
in the beginning of the init script and implement that function. Afterwards you can call
Code:
/etc/init.d/mysql reload
.
Back to top
View user's profile Send private message
Gentoo Server
Apprentice
Apprentice


Joined: 21 Jul 2003
Posts: 279

PostPosted: Wed Apr 06, 2005 3:58 pm    Post subject: Reply with quote

sure but the scripts which support this "reload" should do that with init.d
other scripts which dont support this can give back a message like "reload settings is not supported"

i think this is a clear addon for gentoo which gives no trouble or?
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Wed Apr 06, 2005 4:18 pm    Post subject: Reply with quote

You mean something like
Code:
/sbin/rc --reload default
which would call the reload function for each init script in the runlevel? That could be implemented with a default reload() function in /sbin/runscript.sh that calls restart() unless the init scripts defines it another way. Sounds like a nice idea.
Back to top
View user's profile Send private message
fourhead
l33t
l33t


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

PostPosted: Wed Apr 06, 2005 6:46 pm    Post subject: Reply with quote

No, I know what the original poster means. On Debian almost all initscripts have a reload() function and this is REALLY nice imho, I'd love to see this in Gentoo. /etc/init.d/nfs has such an function for example, it re-reads /etc/exports without restarting the server. Such a function is almost a MUST for /etc/init.d/ssh when you change the sshd config on a remote machine and want to reload the config. If you'd do /etc/init.d/ssh restart on the remote machine you're lost if something goes wrong (config syntax error etc.). You could easily do it for yourself of course, but it shouldn't be much work to implement it for all daemons that support it. I vote for it!!

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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