Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to reset rc status
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
xsong
n00b
n00b


Joined: 26 Nov 2004
Posts: 27

PostPosted: Sat Aug 06, 2005 10:37 pm    Post subject: How to reset rc status Reply with quote

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
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sat Aug 06, 2005 10:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dlareh
Advocate
Advocate


Joined: 06 Aug 2005
Posts: 2102

PostPosted: Sun Aug 07, 2005 2:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Sun Aug 07, 2005 8:45 am    Post subject: Reply with quote

Moved from Installing Gentoo to Other Things Gentoo.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sun Aug 07, 2005 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
xsong
n00b
n00b


Joined: 26 Nov 2004
Posts: 27

PostPosted: Sun Aug 07, 2005 1:53 pm    Post subject: Reply with quote

Got it. thanks.
_________________
----------------------------------------------------
You should work really hard to earn a decent life!!
Do I? Don't I?
---------------------------------------------------
Back to top
View user's profile Send private message
Dlareh
Advocate
Advocate


Joined: 06 Aug 2005
Posts: 2102

PostPosted: Sun Aug 07, 2005 5:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sun Aug 07, 2005 6:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dlareh
Advocate
Advocate


Joined: 06 Aug 2005
Posts: 2102

PostPosted: Sun Aug 07, 2005 6:50 pm    Post subject: Reply with quote

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
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