Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28681 - samba init script problem
Summary: samba init script problem
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-14 03:31 UTC by sthom
Modified: 2004-02-14 22:20 UTC (History)
0 users

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


Attachments
full script with modified stop function (samba,1.44 KB, text/plain)
2003-09-14 03:33 UTC, sthom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sthom 2003-09-14 03:31:52 UTC
Hi, 
 
I made a modification to the samba script for stopping the daemon. Sometimes  
the nmbd is not started and then it is not possible to stop via init script even the 
process smbd. Fixed this in the script by reading the 'ps ax' and checking the  
pid-files, too. This is working fine. Would be great if this still works in  
future ebuids. 
 
Regards 
Sascha 
 
--- my modified stop() part ----------- 
 
stop() { 
        ebegin "Stopping samba" 
        ebegin "    smbd" 
        filepsid=$(cat /var/run/samba/smbd.pid) 
        # echo "smbd should run on ps: $filepsid" 
        psid=$(ps -p $filepsid | tail -1 | cut -d ' ' -f 2) 
        # echo $psid 
        if [ "$filepsid" = "$psid" ] ; then 
                start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid 
                result=$? 
        else 
                echo "        ...was not running." 
                echo "" > /var/run/samba/smbd.pid 
        fi 
 
        ebegin "    nmbd" 
        filepsid=$(cat /var/run/samba/nmbd.pid) 
        # echo "nmbd should run on ps: $filepsid" 
        psid=$(ps -p $filepsid | tail -1 | cut -d ' ' -f 2) 
        # echo $psid 
        if [ "$filepsid" = "$psid" ] ; then 
                start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid 
                result=$(( $result + $? )) 
        else 
                echo "        ...was not running." 
                echo "" > /var/run/samba/nmbd.pid 
        fi 
        eend $result 
}
Comment 1 sthom 2003-09-14 03:33:03 UTC
Created attachment 17683 [details]
full script with modified stop function
Comment 2 Donny Davies (RETIRED) gentoo-dev 2003-09-25 14:18:12 UTC
I dont like this.  Why arent your daemons running I wonder?
Comment 3 Donny Davies (RETIRED) gentoo-dev 2004-02-14 22:20:55 UTC
i dont think theres a bug here!