-   Programming (
-   -   simple script but error (

ryedunn 03-10-2004 03:15 PM

simple script but error
Im reading an article on how to compile/run samba manually... everything is going great but in the article it reads to create a file and put this in it:

# Begin /etc/init.d/samba

# Include the functions declared in the /etc/init.d/functions file

source /etc/init.d/functions

case "$1" in
                echo -n "Starting Samba daemon..."
                loadproc /usr/local/sbin/nmbd

                echo -n "...Samba daemon started!"
                loadproc /usr/local/sbin/smbd

                echo -n "Stopping Samba daemon!"
                killproc smbd

                echo -n "...Samba daemon stopped."
                killproc nmbd

        echo -n "Reloading Samba daemon configuration file..."
                reloadproc smbd
        ireloadproc nmbd

                $0 stop
                /usr/bin/sleep 1
                $0 start

                statusproc /usr/local/sbin/nmbd
                statusproc /usr/local/sbin/smbd

                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1


# End /etc/init.d/samba

the problem is that Im getting the error: loadproc not found.

Im sure its a easy fix but Im still learning so Im not sure if that and the other commands (statusproc, ireloadproc, etc..) will work.

Thank you,
The GNUbie

acid_kewpie 03-10-2004 05:13 PM

these functions will be defined in "/etc/init.d/functions", the source command works the same an a #include in c.... these functions are not universal across linux, most distros write their own. have a look at your own functions script, and an existing init script for a service like... gpm, cron or similar to see the equivalent functions they use and adapt accordingly

ryedunn 03-10-2004 10:47 PM

Cool but one last thing
Thank you really helped a lot but this is strange, the script says:
Which should work but when I try to run it from the command line I get the same error as when its ran:
bash: ./usr/local/sbin/nmbd: No such file or directory
BUT, when I
#cd /usr/local/sbin
it works just fine. WTF is going on????

The GNUbie

bigearsbilly 03-11-2004 04:01 AM

should that not be:




lose the dot


ryedunn 03-11-2004 07:02 AM

yeup... thanks again.

All times are GMT -5. The time now is 09:11 PM.