LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-10-2004, 03:15 PM   #1
ryedunn
Member
 
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 458

Rep: Reputation: 30
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:
Code:
#!/bin/sh
# Begin /etc/init.d/samba

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

source /etc/init.d/functions

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

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

        stop)
                echo -n "Stopping Samba daemon!"
                killproc smbd

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

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

        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/local/sbin/nmbd
                statusproc /usr/local/sbin/smbd
                ;;

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

esac

# 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
 
Old 03-10-2004, 05:13 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
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
 
Old 03-10-2004, 10:47 PM   #3
ryedunn
Member
 
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 458

Original Poster
Rep: Reputation: 30
Cool but one last thing

Chris,
Thank you really helped a lot but this is strange, the script says:
./usr/local/sbin/nmbd
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
#./nmbd
it works just fine. WTF is going on????

The GNUbie
 
Old 03-11-2004, 04:01 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,284

Rep: Reputation: 172Reputation: 172
should that not be:

/usr/local/sbin/nmbd

NOT

./usr/local/sbin/nmbd


lose the dot

billy
 
Old 03-11-2004, 07:02 AM   #5
ryedunn
Member
 
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 458

Original Poster
Rep: Reputation: 30
yeup... thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
New to C++ help with simple script Fredstar Programming 9 08-08-2005 11:09 AM
Help on simple script granny Programming 2 02-11-2004 04:02 PM
Simple Script fiod Linux - General 2 09-08-2003 03:03 PM
Simple C Shell script is not so simple elconde Programming 2 09-16-2001 11:53 PM


All times are GMT -5. The time now is 04:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration