LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-30-2004, 10:31 PM   #1
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Rep: Reputation: 30
Script with root rights on startup - swap space initialization


Hi,

I would like to have a script run on startup with root rights, so I have placed the script in
/etc/init.d/
and given it execution rights - it still doesn't run on startup, what do I have to do ??

The content of the script is as follows:
swapon /home/troels/old_linux/swapfil
swapon /home/troels/old_linux/swapfil1
swapon /home/troels/old_linux/swapfil2

It basically initializes my swap space defined in /etc/fstab as follows:
/home/troels/old_linux/swapfil none swap defaults 0 0
/home/troels/old_linux/swapfil1 none swap defaults 0 0
/home/troels/old_linux/swapfil2 none swap defaults 0 0

Any comments on this procedure would be great :-)
 
Old 06-30-2004, 10:48 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Try
/sbin/swapon
in the script ... but why in the workd are you using 3 swap-files
rather than a swap-partition?


Cheers,
Tink
 
Old 06-30-2004, 11:04 PM   #3
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
The script is not being run (I have an echo statement that I never see on startup) - so I don't think /sbin/swapon will help.

I use swap files because the need for futher swap space arised suddenly the other day and I was in need of a fast solution.

Thanks for the reply !
 
Old 06-30-2004, 11:55 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
Scripts in init.d don;t automatically run when the machine boot, they get run when init parses the /etc/rc.d/rc[0-6]d directories (Slackware does it slightly differently). Probably the easiest way to make your script run is jusyt add it to the rc.local file.
 
Old 06-30-2004, 11:58 PM   #5
TroelsSmit
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Debian / Suse
Posts: 223

Original Poster
Rep: Reputation: 30
Sorry for being a newbee but 'locate rc.local' doesn't yield any results.
Exactly which file are you talking about ?
/etc/rc3... ??
 
  


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
how to reduce swap space and reclaim the space grantm Linux - Newbie 7 08-16-2012 07:05 AM
making a script run with root rights box_l Programming 12 02-10-2005 09:44 PM
Lauching script at shell startup without having root access. begin55676 Linux - Newbie 2 12-10-2004 03:42 PM
Fluxbox startup script.......... App requires root. DraaX Slackware 2 11-28-2004 08:27 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM


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

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