Making rc.local work on F20.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There has been discussion of what it takes to make rc.local work. It seems that some people are struggling with it.

There are a couple of important details, but for the most part, It's almost trivial, as long as your not missing the important parts.

First thing I did was:

# cd/etc
# echo '$!/bin/bash' > /rc.d/rc.local
# ln -s rc.d/rc.local rc.local # because certain things are just burned into my brain.
# chmod 755 rc.d/rc.local
# vi /etc/rc.local

Setting the file permissions and making sure '#!/bin/bash' at the top are VERY important.

So, if you are poking around on my system:

# ls -l /etc/rc.local
lrwxrwxrwx. 1 root root 13 Mar  1 13:47 /etc/rc.local -> rc.d/rc.local

# ls -l /etc/rc.d/rc.local
-rwxr-xr-x. 1 root root 376 Jun 26 09:05 /etc/rc.d/rc.local

# cat /etc/rc.local
#!/bin/bash

# Fix the scheduler of the SSD
#
# changed to use deadline per benchmarks:
# http://www.phoronix.com/scan.php?item=linux_316_iosched&page=article
# 2014-06-26    dw2
#
# echo noop > /sys/block/sda/queue/scheduler
echo deadline > /sys/block/sda/queue/scheduler

#
# send an email on a (re)boot
#
echo $(hostname) booted on $(date) | mail -s "$(hostname) boot" root

And as you can see, it works:

# systemctl status rc-local
rc-local.service - /etc/rc.d/rc.local Compatibility
   Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
Active: active (exited) since Tue 2014-10-07 23:20:39 EDT; 2 weeks 3 days ago
 Main PID: 1036 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rc-local.service

Oct 07 23:20:39 tesla systemd[1]: Started /etc/rc.d/rc.local Compatibility.
Oct 07 23:20:39 tesla sendmail[1036]: s983Kd5f001036: from=root, size=244, ...st Oct 07 23:20:40 tesla sendmail[1036]: s983Kd5f001036: to=root, ctladdr=root...y)
Hint: Some lines were ellipsized, use -l to show in full.


# cat /sys/block/sda/queue/scheduler
noop [deadline] cfq

That's it.

Really, all you need is to create a proper shell script in /etc/rc.d/rc.local with the correct permissions and it should work.

--
-- Derrik

Derrik Walker v2.0, RHCE
dwalker@xxxxxxxxx

"Those UNIX guys, they think weird!" -- John C. Dvorak

--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux