LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-23-2007, 02:50 AM   #1
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Rep: Reputation: 30
Startup script access right


I put iptables script in /init.d in ubuntu and update the runlevel with
update-rc.d filename defaults
The script with system command iptables inside.


1 how can I start up the script when non-root users login? Now the things can not procede when user and password entered.

2 how can I login as root to delete the script file? I can not login from the default menu session. Can I login from failsafe text mode? Using installation disk seems not help.


Thank you for help.
 
Old 07-23-2007, 03:17 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Lets get this clear, you put the iptables commands for your firewall in a script (lets call it firewall.sh) mhich you moved to the directory /etc/init.d so the command to start your firewall would be

sudo /etc/init.d/firewall.sh

If this is correct, then you need to add the line:

/etc/init.d/firewall.sh

...to the bottom of your /etc/rc.local file. Then it will start at boot every time regardless of the user.
 
Old 07-23-2007, 03:25 AM   #3
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Original Poster
Rep: Reputation: 30
Thank you for the help Simon,

The firewall.sh file in /etc/init.d/ and also in /etc/rcX.d
I could add the path to the bottom of /etc/rc.local file.

My question should be, what is the update run level update-rc.d for

Last edited by fhleung; 07-23-2007 at 05:32 AM.
 
Old 07-23-2007, 04:00 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
I could add the file to the bottom of /etc/rc.local file.
No... you add the filename and path to that file. Not the whole file!

And take it out of all those rcX.d directories... it don't belong there.

You gotta boot to a rescue image from the grub menu. If that dosn't work, use the live CD.

Note: you shouldn't use a root account in ubuntu anyway.
(Surely the root login gets as far as the password too?)

Last edited by Simon Bridge; 07-23-2007 at 04:01 AM.
 
Old 07-24-2007, 07:49 PM   #5
fhleung
Member
 
Registered: Aug 2004
Distribution: Lubuntu Live OS
Posts: 432

Original Poster
Rep: Reputation: 30
Startup script access right error in rc.local

I put my iptables script and executed inside the rc.local

When I run the rc.local script, either in
etc/init.d/rc.local and /etc/rc.local

there were
Permission denied and
Permission denied (you must be root) messages.
 
Old 07-24-2007, 08:03 PM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
reboot.........
 
  


Reply



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
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Startup script Larsza SUSE / openSUSE 7 10-21-2005 06:59 AM
startup script ... again. Vindane Linux - Wireless Networking 2 03-04-2005 02:57 AM
Lauching script at shell startup without having root access. begin55676 Linux - Newbie 2 12-10-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:55 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
Open Source Consulting | Domain Registration