LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-19-2005, 02:00 PM   #1
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Rep: Reputation: 15
Prob Getting No-IP to start


I'm trying to get the No-IP client to start automatically so I can SSH in to my computer from anywhere. Right now what I tried does not work, It doesn't start on boot. Their directions don't seem in line with how the startup scripts are set up for Slackware so I tried to do my own.

Here's what I did:

make
su
make install
chmod 700 /usr/local/bin/noip2
chown root:root /usr/local/bin/noip2
chmod 600 /usr/local/etc/no-ip2.conf
chown root:root /usr/local/etc/no-ip2.conf

Then made /etc/rc.d/rc.no-ip abd added the following to the end of /etc/rc.d/rc.M

#Start the no-ip client
if [ -x /etc/rc.d/rc.no-ip ]; then
. /etc/rc.d/rc.no-ip
fi

and here's what /etc/rc.d/rc.no-ip looks like

no_ip_start() {
if [ -x /usr/local/bin/noip2 -a -r /usr/local/etc/no-ip2.conf ]; then
echo "Starting No-IP: /usr/local/bin/noip2"
/usr/local/bin/noip2
fi
}

no_ip_stop() {
kill noip2
}

no_ip_restart() {
no_ip_stop
sleep 2
no_ip_start
}

case "$1" in
'start')
no_ip_start
;;
'stop')
no_ip_stop
;;
'restart')
no_ip_restart
;;
*)
no_ip_start
esac

So my main question is why doesn't this work? But also I know -x means exists and is executable, -r means exists and is readable, but what does -a mean? I just copied this script pretty much from the rc.samba file so I'm not entirely sure it's right. The No-IP directions suggest a different script. They first have you find the default runlevel (i think) by doing this:

grep initdefault /etc/inittab | awk -F: '{print $2}'

for me that returns 3 so they say name the file rc.3. I wanted to try to stay in line with Slackware style and not add this file by instead doing what I did above. But anyway here is what their script looks like:

#! /bin/sh
case "$1" in
start)
echo "Starting noip2."
/usr/local/bin/noip2
;;
stop)
echo -n "Shutting down noip2."
killproc -TERM /usr/local/bin/noip2
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0

Another thing I don't understand is why the case statement, I believe the $1 refers to the first parameter passed when the script is called, how/when is this done? And why do you think they used killproc? Don't almost all Unix/Unix-look-a-like's have kill for sending the TERM signal to processes? As you can see that's what I used in my script.

BTW I can get it to start if I actually do su and manually start it, yet the USER seems odd TOP says its user is "nobody" Shouldn't be root?

Last edited by mjl3434; 03-19-2005 at 02:02 PM.
 
Old 03-19-2005, 02:28 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
What are the permissions on /etc/rc.d/rc.no-ip? If it's not executable the if [ -x ] will fail. The no-ip daemon is probably set to run as a nonprivilidged user for security reasons.
 
Old 03-19-2005, 02:47 PM   #3
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Original Poster
Rep: Reputation: 15
Well its not the permissions.

As my post said I had them set to 700 but I set the to 777 and rebooted and it still did not start up. Plus wouldn't I want the no-ip client to only be run with root permission since I pretty much dont want any user to be able to stop it or mess with it's settings?
 
Old 03-19-2005, 03:26 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
You might put an echo statement in the if block in /etc/rc.d/rc.M to make sure that it is seeing /etc/rc.d/rc.no-ip and trying to execute it. Also, I think I see another issue -- you mention having some douby about the $1 in the case statement -- that is the first parameter passed, but you never pass a parameter. The start|stop|restart parameters are passed automatically in SysV style initilization, but not in BSD style, which is what Slackware uses -- try adding "start" as an argument to your script. Also, the case statement should have start) not 'start').

As for permissions, no one except for root and nobody will be able to kill nobody's processes. Nobody is an account that no one should have access to, so unless you've made a massive security mistake, you're safe.
 
Old 03-19-2005, 04:13 PM   #5
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Original Poster
Rep: Reputation: 15
Yes thank you.

I removed the 'start' and made it start, likewise with the others. I added the extra echo. And also although I explicity remember changing the permission on the executable, and again to full permissions it was not set correctly. I have no idea why this happened but I set it to 700 and all worked! Excellent. Also yeah -a means and, 30 sec of messing around at a prompt let me figure out what was working and what wasn't. Now only to test it. Who wants my login and password so we can test this thing?

Haha, no I dont think so.
 
  


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
when i try to start samba pdc's smb service nmbd failed to start . sandeepchau123 Linux - Newbie 2 10-20-2007 02:59 PM
red hat 9, printer prob and connection prob lasttriptotulsa Linux - Newbie 4 01-17-2007 04:39 AM
disable cold start and warm start snmp traps chkisco Linux - Newbie 0 10-28-2005 03:58 AM
XFree keyboard problem, Quake prob and half-life prob cradlebin Linux - Software 0 09-21-2003 07:57 AM
Man 9.0 printer ? hardware prob ? install prob romcgill Linux - Hardware 2 02-24-2003 05:54 AM


All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration