LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fedora18 want to run a script at end of boot cycle. HOW? (http://www.linuxquestions.org/questions/linux-newbie-8/fedora18-want-to-run-a-script-at-end-of-boot-cycle-how-4175448048/)

lleb 01-31-2013 03:47 PM

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.

acid_kewpie 01-31-2013 03:48 PM

put it in /etc/rc.local

lleb 01-31-2013 03:54 PM

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/


jpollard 01-31-2013 09:49 PM

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.

lleb 01-31-2013 11:05 PM

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.

acid_kewpie 02-01-2013 02:10 AM

d? what's d? an alias for ls -d? /etc/rc.local is a *FILE* not a directory.

lleb 02-01-2013 05:49 PM

Quote:

Originally Posted by acid_kewpie (Post 4882007)
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.

acid_kewpie 02-02-2013 02:27 AM

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.

jpollard 02-02-2013 05:13 AM

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".

lleb 02-02-2013 06:17 AM

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.

goumba 02-02-2013 06:24 AM

Quote:

Originally Posted by acid_kewpie (Post 4881657)
put it in /etc/rc.local

That should be 'edit and add to /etc/rc.local'.

lleb 02-02-2013 09:19 PM

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.


All times are GMT -5. The time now is 08:30 PM.