Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25168 - /etc/init.d/nfsmount script: restart() not using svc_stop/svc_start
Summary: /etc/init.d/nfsmount script: restart() not using svc_stop/svc_start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-24 00:44 UTC by Chris Williams
Modified: 2005-03-01 15:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Williams 2003-07-24 00:44:08 UTC
root # /etc/init.d/nfsmount restart

 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run nfsmount without arguments for more info.

 * Unmounting NFS filesystems...  [ ok ]
 * Stopping NFS statd...          [ ok ]
 * Starting NFS statd...          [ ok ]
 * Mounting NFS filesystems...    [ ok ]


With the desired result is achieved, the complaint is valid.

Reproducible: Always
Steps to Reproduce:
1. # /etc/init.d/nfsmount restart

Actual Results:  
 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run nfsmount without arguments for more info.



Expected Results:  
restart() function should use svc_stop and svc_start, not stop and start as it
does now.
Comment 1 Chris Williams 2003-07-24 00:47:19 UTC
The offending file is in net-fs/nfs-utils version 1.0.5-r1.
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-07-24 10:17:23 UTC
azarah: the same error msg happens in shorewall

i think it should'nt be displayed, cause some apps provide restart functions by themself
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-24 11:16:36 UTC
True, but the issue is not restart(), but using stop() and start() instead
of svc_{start,stop}() that does the dependency handling.  Yes, the check
is a bit braindead.

Anyhow - what version of baselayout ... I do not get that here.  This
is with latest version of the script in cvs.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-24 11:21:30 UTC
I actually checked the shorewall script:

---------------------------------------
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later

opts="start stop restart"

depend() {
        need net
        provide firewall
}

start() {
        ebegin "Starting firewall"
        /sbin/shorewall start 1>/dev/null
        eend $? 
}

stop() {
        ebegin "Stopping firewall"
        /sbin/shorewall stop 1>/dev/null
        eend $?
}

restart() {
        ebegin "Restarting firewall"
        /sbin/shorewall restart
        eend $?
}
-----------------------------------

This is plain *wrong*.  Sure it does
behave as expected, but not how it should be done.

By default the system provide a restart function.  If he
however wants to do his own (like in this case to change
the message printed), he should do it like this:

----------------------------
restart() {
    ebegin "Restarting firewall"
    svc_restart
    eend $?
}
----------------------------

Comment 5 Martin Holzer (RETIRED) gentoo-dev 2003-07-24 11:26:51 UTC
sys-apps/baselayout-1.8.6.8-r1 does this for me
Comment 6 SpanKY gentoo-dev 2003-10-20 22:58:01 UTC
this still an issue ?
Comment 7 Chris Williams 2003-10-21 05:03:44 UTC
Yes, the restart() function still uses start() and stop() rather than svc_stop/svc_start

chrisw@newton chrisw $ qpkg -v -f /etc/init.d/nfsmount
net-fs/nfs-utils-1.0.6 *
chrisw@newton chrisw $ tail -4 /etc/init.d/nfsmount
restart() {
        stop
        start
}
newton root # /etc/init.d/nfsmount restart

 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run nfsmount without arguments for more info.

 * Unmounting NFS filesystems...                                        
 [ ok ]
 * Stopping NFS statd...                                                
 [ ok ]
 * Starting NFS statd...                                                
 [ ok ]
 * Mounting NFS filesystems...                                          
 [ ok ]
Comment 8 John Davis (zhen) (RETIRED) gentoo-dev 2003-12-18 21:06:35 UTC
yes, it is, not to mention that rpc.statd does not honor the cmd line options set for it in /etc/conf.d/nfs (which is a big prob, esp if you are attempting to use nfs + a firewall)
Comment 9 Martin Holzer (RETIRED) gentoo-dev 2004-01-12 14:10:51 UTC
this is fixed with latest files

for other issue see bug #21835
Comment 10 Emil Beinroth 2005-01-01 13:47:33 UTC
This bug is not fix:
appro root # /etc/init.d/nfsmount restart

 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run nfsmount without arguments for more info.
 
 * Re-caching dependency info (mtimes differ)...
 * Unmounting NFS filesystems...                                                                                         [ ok ]
 * Mounting NFS filesystems...                                                                                           [ ok ]
appro root # qpkg -nc -f -v /etc/init.d/nfsmount 
net-fs/nfs-utils-1.0.6-r6

Why not remove the restart-function from the script?
Comment 11 Douglas Peter Sculley 2005-03-01 15:59:33 UTC
This is still a issue for me also.

 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run nfsmount without arguments for more info.

Also running net-fs/nfs-utils-1.0.6-r6