Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all. I've had linux for a while now and have finally gotten sick of having to load my modem from the command line every time that I want to use it. So, I found a start up script that was included in later smartlink drivers. (not smart enough to write my own - yet) To start with, I had better say that this is on debian sarge. Now what I did was copy the script into /etc/init.d. Then I linked it with /etc/rd5.d and rc6.d for startup and shutdown. It doesn't work when I boot up but if I run /etc/init.d/slmodemd start, then the modem starts up. Now here is the funny part, in that now when I shut down my computer it appears that the modem is being started then. I get the following messages "--exec requires argument and also "see start-stop-daemon --help" and then I get the message that I normally get when the modem starts up and the computer wont shut down. The exec argument is in the script that I will include shortly. Does anyone know what I have done wrong? Obviously the script works as it starts the modem, its just my setting it up in init.d I think. In rc5.d the link is "S92slmodemd" which is linked to /etc/init.d and in rc6.d its "K29slmodemd" Hers the script
#!/bin/sh
#
# slmodemd: Starts the SmartLink Modem Daemon
#
# chkconfig: 345 90 10
# description: This is the user space part of the SmartLink Modem driver
# processname: slmodemd
# config: /etc/sysconfig/slmodem
# Source function library.
#. /etc/init.d/functions
# Test presence of daemon binary
test -f $DAEMON || exit 0
# Source configuration
CONFIG=/etc/default/$NAME
if [ -f $CONFIG ]; then
. $CONFIG
else
echo "
#
# This is the default configuration for the slmodem driver daemon
# running on Debian systems.
#
# Edit device node and country code here ...
#
# possible country codes are:
#
# USA
# GERMANY
# BELGIUM
# etc.
#
# use \'$DAEMON --countrylist\' to check out other countries
#
SLMODEMD_DEVICE=slamr0
SLMODEMD_COUNTRY=AUSTRALIA
" > $CONFIG
fi
# uncomment this if you want this feature (if necessary edit module
#pattern):
# do not try to start on a kernel which does not support it
grep 'slamr\..*o' /lib/modules/`uname -r`/modules.dep > /dev/null || { \
echo "SmartLink modem driver not supported by Kernel `uname -r`. Exiting
..."
exit 0
# Source function library.
#. /etc/init.d/functions
If there is a file /etc/init.d/functions then you should un-comment the above line.
Otherwise I don't see where the function start-stop-daemon is comming from. Debian has a file that is equivalent to /etc/init.d/functions but I don't remember the name of the file. Try looking through some of the other scripts in /etc/init.d to see how dameons are started.
Sorry I can't be more help but I'm stuck on a windows machine right now.
The slamr module is already in /etc/modules and gets loaded at startup. (Dont think that has anything to do with it as I can start the modem from the script, without having to load the module) its just that it wont start at startup. Could be wrong though. Debian doesnt have rc.local. Just rc.0 ,.1, .2 etc.
/bin/bash
Not sure what you are saying. Is the command not working cause there is no link to the function? Like its not a shell command? Sorry but as I said, I dont know much about scripting.
Your script is calling the function start-stop-daemon but that function is not in your script anywhere so I think it is probably in the functions script. If that is the case then you need to un-comment the line that sources the functions script.
#. /etc/init.d/functions
Of course if you don't have the functions script then that will just cause an error.
<edit> If it is a program like dustu76 suggested then nevermind
Start-stop-daemon is a program (script?) and functions isnt in init.d. Its funny because I only get that error when the modem isnt running and I shut down the computer. The machine wont shut down cause the modem has just started up, but if the modem is running then the machine shuts down ok. Like I said, if I start it by running the script from a shell ie /etc/init.d/slmodemd start, then the modem starts up. This makes me think that the script is ok, its just that for some reason, it wont start as it enters runlevel 5. From what I can tell, its doing something as it goes into runlevel 6 but I cant tell whats really going on cause I dont really know that much about the whole process
1. The script is starting when the user is firing the command but not during startup. One of the difference between these two situations could be environment like the variable PATH. If Start-stop-daemon is a program then it is possible that it is a directory which is not the PATH. What you could try is creating a softlink to the program in /usr/bin :
Cheers dusta, but no joy with that suggestion. Might try this in the debian forum as i'm pretty sure that its got to do with the links and something with the run levels.
Thanks to all.
?bin/bash, yep had to edit a couple of lines, cause where I copied it from, the web site must have cut it and when I ran it, was getting that error about needing an argument. Once that was fixed, I couldn't work out why it wouldn't work at bootup and shutdown. Then read something in the init.d readme about the policy manual, and lo and behold, the answer was in there. All I had to do was run "rcd-update" pointing to the script and it did the rest.
Rebooted and all worked beautifully.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.