View previous topic :: View next topic |
Author |
Message |
xsong n00b
Joined: 26 Nov 2004 Posts: 27
|
Posted: Sat Aug 06, 2005 10:37 pm Post subject: How to reset rc status |
|
|
rc-status report the mysql is running, but actaully it stops. How to reset it and then I can use /etc/init.d/mysql to restart mysql? _________________ ----------------------------------------------------
You should work really hard to earn a decent life!!
Do I? Don't I?
--------------------------------------------------- |
|
Back to top |
|
|
JPMRaptor Guru
Joined: 04 Oct 2002 Posts: 410 Location: Maryland
|
Posted: Sat Aug 06, 2005 10:48 pm Post subject: |
|
|
Try Code: | /etc/init.d/mysql restart |
If that gives you some error indicating that it can't stop because it isn't really running try
Code: | /etc/init.d/mysql zap
/etc/init.d/mysql start |
_________________ Underwater photo gallery
New pictures, Oct 2005 |
|
Back to top |
|
|
Dlareh Advocate
Joined: 06 Aug 2005 Posts: 2102
|
Posted: Sun Aug 07, 2005 2:40 am Post subject: |
|
|
Is there a way to "pretend" a service has been started? i.e. have rc register mysql as having been started, even though one may be starting it manually instead (to try out different options, or somesuch).
The reason would be so that other init scripts that depend on mysql would see it as already having been started...
I would probably use this for net.* stuff, too. Sometimes I want e.g. sshd to keep running, even though net.ath0 and net.eth0 may be down. Right now I use a net.fake that does nothing.... which is a reasonable hack, but doesn't work with non-net init scripts. |
|
Back to top |
|
|
Maedhros Bodhisattva
Joined: 14 Apr 2004 Posts: 5511 Location: Durham, UK
|
Posted: Sun Aug 07, 2005 8:45 am Post subject: |
|
|
Moved from Installing Gentoo to Other Things Gentoo. _________________ No-one's more important than the earthworm. |
|
Back to top |
|
|
JPMRaptor Guru
Joined: 04 Oct 2002 Posts: 410 Location: Maryland
|
Posted: Sun Aug 07, 2005 1:38 pm Post subject: |
|
|
How about Code: | /etc/init.d/mysql pause |
You can see a description of what options are available for each of the init scripts by running them with no options. _________________ Underwater photo gallery
New pictures, Oct 2005 |
|
Back to top |
|
|
xsong n00b
Joined: 26 Nov 2004 Posts: 27
|
Posted: Sun Aug 07, 2005 1:53 pm Post subject: |
|
|
Got it. thanks. _________________ ----------------------------------------------------
You should work really hard to earn a decent life!!
Do I? Don't I?
--------------------------------------------------- |
|
Back to top |
|
|
Dlareh Advocate
Joined: 06 Aug 2005 Posts: 2102
|
Posted: Sun Aug 07, 2005 5:51 pm Post subject: |
|
|
JPMRaptor wrote: | How about Code: | /etc/init.d/mysql pause |
You can see a description of what options are available for each of the init scripts by running them with no options. |
That does not help me if the service hasn't been started yet but I need to pretend it has been... |
|
Back to top |
|
|
JPMRaptor Guru
Joined: 04 Oct 2002 Posts: 410 Location: Maryland
|
Posted: Sun Aug 07, 2005 6:24 pm Post subject: |
|
|
An entry in /var/lib/init.d/started may do it. I don't think there's a non-hack way to do it. _________________ Underwater photo gallery
New pictures, Oct 2005 |
|
Back to top |
|
|
Dlareh Advocate
Joined: 06 Aug 2005 Posts: 2102
|
Posted: Sun Aug 07, 2005 6:50 pm Post subject: |
|
|
JPMRaptor wrote: | An entry in /var/lib/init.d/started may do it. I don't think there's a non-hack way to do it. |
Yay, a new addition to my wrapper collection:
Code: | # simplified init.d wrappers
function start {
if [ -e /etc/gentoo-release ]; then
su -c "/etc/init.d/$@ pause;
/etc/init.d/$@ zap;
/etc/init.d/$@ start;"
else
su -c "/etc/init.d/$@ restart"
fi
}; alias restart=start
function stop {
su -c "/etc/init.d/$@ stop"
}
function pause {
su -c "/etc/init.d/$@ pause"
}
function zap {
su -c "/etc/init.d/$@ zap"
}
function status {
if [ -z "$@" ]; then
rc-status | grep off
else
su -c "/etc/init.d/$@ status"
fi
}
function fakestart {
su -c "cd /var/lib/init.d/started; ln -sf /etc/init.d/$@"
} |
|
|
Back to top |
|
|
|