View previous topic :: View next topic |
Author |
Message |
Gentoo Server Apprentice
Joined: 21 Jul 2003 Posts: 279
|
Posted: Wed Apr 06, 2005 9:20 am Post subject: can we add a new init.d state refresh |
|
|
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 |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Wed Apr 06, 2005 9:55 am Post subject: |
|
|
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 |
|
|
Gentoo Server Apprentice
Joined: 21 Jul 2003 Posts: 279
|
Posted: Wed Apr 06, 2005 3:58 pm Post subject: |
|
|
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 |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Wed Apr 06, 2005 4:18 pm Post subject: |
|
|
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 |
|
|
fourhead l33t
Joined: 03 Sep 2003 Posts: 875 Location: Cologne, Germany
|
Posted: Wed Apr 06, 2005 6:46 pm Post subject: |
|
|
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 |
|
|
|