LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-31-2013, 03:47 PM   #1
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Fedora18 want to run a script at end of boot cycle. HOW?


i have a simple script to test if the laptop is at home and if it is then to mount the local NFS share. I tried putting it in /etc/rc.d/init.d/ that did not work.

i have tested the script it runs fine when manually run and by putting the script in /etc/rc.d/init.d i can run service foo start and it works great.

sadly I didnt create it for that as it does not have an option to umount the share so i cant service foo stop. not a big deal, but again not my goal. I want this script to run at the end of the boot up so my daughter does not have to fight with the system to get access to the home NFS.

i have tried adding it to fstab and using autofs, both give all kinds of issues and errors. mainly permissions as F18 does not like running and connecting to NFSv3.

thanks in advance.
 
Old 01-31-2013, 03:48 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
put it in /etc/rc.local
 
Old 01-31-2013, 03:54 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
no such file/directory.

Code:
[kayla@localhost ~]$ d /etc/rc.*
total 48
drwxr-xr-x.  10 root root  4096 Dec  7 16:31 ./
drwxr-xr-x. 145 root root 12288 Jan 31 16:53 ../
drwxr-xr-x.   2 root root  4096 Jan 31 16:30 init.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc0.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc1.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc2.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc3.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc4.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc5.d/
drwxr-xr-x.   2 root root  4096 Dec 25 11:35 rc6.d/

Last edited by lleb; 01-31-2013 at 03:56 PM.
 
Old 01-31-2013, 09:49 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,149

Rep: Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549
Unfortunately, unless you modify the configuration for rc.local it will run BEFORE the system is up.

You have to run it AFTER the network is ready... and that can vary all over the place.

Fedora no longer has a valid sysV init system. It just runs them willy-nilly.
 
Old 01-31-2013, 11:05 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
from reading it has replaced sysV with systemd. ill be working with my LUG this weekend to get the issue resolved. its more about me not understanding Fedora 18 and the way it handles all of the changes for networking to my house NFS server.

Thank you for the help. Ill post back after Sat. with how things are resolved.
 
Old 02-01-2013, 02:10 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
d? what's d? an alias for ls -d? /etc/rc.local is a *FILE* not a directory.
 
Old 02-01-2013, 05:49 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by acid_kewpie View Post
d? what's d? an alias for ls -d? /etc/rc.local is a *FILE* not a directory.
sadly im not 100% sure. when i get the info tomorrow at my LUG, ill be more then happy to post it here. all i know is that it is something new with Fedora 18 as sysV has been depreciated.
 
Old 02-02-2013, 02:27 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,386

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
huh? no, you ran a command called "d", surely that's nothing to do with init scripts, you're just listing directories, no? /etc/rc.local should still be a writable file.
 
Old 02-02-2013, 05:13 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,149

Rep: Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549
He is referring to systemd - a hodge-podge merger of init, inetd, dbus, and udev. The SysVinit system does not exist except in name only. All init scripts run at any time after root is mounted, and in parallel with all other setup functions. It is roughly controlled by creating explicit dependency lists in dozens of configuration files describing each facility being started. If you have something that needs the network, then it must be run after the network is "ready"... Unfortunately, that depends on how the network is started... NetworkManager by default marks it "ready" when it has started... and unless another wait point is marked (NetworkManager-wait-online) then it might not actually be ready. Even then, if the network depends on wireless it may still not be "quite ready".
 
1 members found this post helpful.
Old 02-02-2013, 06:17 AM   #10
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
ahh thank you, that sounds a bit like what one of the guys at my LUG was telling me via e-mail. im about to head off to my boys pine-wood-derby, then shortly after the LUG meeting for an install fest. there we will be working on both the laptop and my server as I shall be learning about what you just talked about jpollard.
 
Old 02-02-2013, 06:24 AM   #11
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 527
Blog Entries: 3

Rep: Reputation: 58
Quote:
Originally Posted by acid_kewpie View Post
put it in /etc/rc.local
That should be 'edit and add to /etc/rc.local'.

Last edited by goumba; 02-02-2013 at 06:39 AM.
 
Old 02-02-2013, 09:19 PM   #12
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,523

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
well sadly I didnt get to "learn" as I had hopped due to time. the guy setup idmapper as well as some other kind of automounter that while is not a symlink nor a loopback it kind of works like that. sorry i sound like an idiot and that is because i truly am not sure exactly what he did.

without moving the files around he was able to change the pathing so now my NFS share resides in /home/ssmahome/public instead of /home/ray/NFS making it simpler for clients to connect.

He also was successful at setting up both NFSv3 and NFSv4 on my server to make mounting simpler on my Fedora 18 laptop without breaking the MACs that do not play nice with NFSv4.

Code:
$ cat /etc/exports 
#
#	/etc/exports

#	NFS4
/exports *(rw,insecure,subtree_check,crossmnt,fsid=0)

#	NFSv3
/exports/centos/public *(rw,insecure,no_subtree_check,fsid=3010)
#NO#HOMEDIRS#	/exports/centos	*(rw,insecure,no_subtree_check,fsid=3000)

[ray@centos TV_Shows]$ d /home/
total 12
drwxr-xr-x.  4 root root 4096 Feb  2 16:15 ./
dr-xr-xr-x. 26 root root 4096 Feb  2 16:18 ../
lrwxrwxrwx.  1 root root   15 Feb  2 10:00 julian -> ssmahome/julian/
lrwxrwxrwx.  1 root root   12 Feb  2 10:00 ray -> ssmahome/ray/
drwxr-xr-x.  7 root root 4096 Feb  2 10:04 ssmahome/
drwxr-xr-x.  2 root root    0 Feb  2 16:18 win7/
[ray@centos TV_Shows]$ d /home/ssmahome/
total 60
drwxr-xr-x.  7 root   root    4096 Feb  2 10:04 ./
drwxr-xr-x.  4 root   root    4096 Feb  2 16:15 ../
drwx------.  2 julian julian  4096 Jan  4 15:49 julian/
drwx------.  2 kayla  kayla   4096 Feb  2 10:04 kayla/
drwx------.  2 root   root   16384 Jan  4 14:38 lost+found/
drwsrwxrwx+  9 ray    ray    20480 Feb  2 16:25 public/
drwx------. 13 ray    ray     4096 Feb  2 16:45 ray/
nice bit of work he did. we did discover a bug in Fedora 18's idmapper as it is supposed to send across the user name, not the UID. it is sending only the UID/GID instead of the User_name/Group_name.

in other words it is sending 1000:1000 instead of kayla:kayla this is breaking permissions for getting into the users home directory on the server. He is going to research it further this weekend and either get with me to fix it if he finds a fix, or post a bug-zilla report to the Fedora community.
 
  


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
LXer: Ubuntu considers “huge” change that would end traditional release cycle LXer Syndicated Linux News 0 01-23-2013 03:40 PM
How to design a fron end to run different shell script? sharp859 Linux - Newbie 8 05-05-2008 07:23 PM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM
Bash script - to save and run a command at the end satimis Programming 15 11-02-2004 08:53 AM
How do you run a print-head cleaning cycle?? Huddlebum Linux - Newbie 1 04-02-2004 03:44 PM


All times are GMT -5. The time now is 09:05 PM.

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