Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 31st July 2012, 07:06 AM
Serophis Offline
Registered User
 
Join Date: Jun 2012
Location: Norway
Posts: 43
linuxfirefox
Can't get rc.local to work

Hi,

I'm trying to get rc-local.service working on my Fedora 17 64-bit system but it keeps failing. I've made it executable and here is the contents:
Quote:
#! /bin/sh
chmod 755 /etc/rc.d/rc.local
ln -s /etc/rc.d/rc.local /etc/
# Use deadline scheduler for SSD-disk
echo deadline > /sys/block/sdb/queue/scheduler
echo 1 > /sys/block/sdb/queue/iosched/fifo_batch
# Write-back caching
hdparm -W1 /dev/sdb
systemctl status rc-local.service shows:
Quote:
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static)
Active: failed (Result: exit-code) since Tue, 31 Jul 2012 07:39:16 +0200; 5min ago
Process: 1818 ExecStart=/etc/rc.d/rc.local start (code=exited, status=127)
CGroup: name=systemd:/system/rc-local.service
I have no idea what I'm doing wrong, and google isn't helping much. I only created rc.local to optimize the OS for SSD.
Reply With Quote
  #2  
Old 2nd August 2012, 01:10 AM
nsnbm Offline
Registered User
 
Join Date: Dec 2007
Location: Melbourne, Australia
Posts: 162
linuxchrome
Re: Can't get rc.local to work

The way I got my rc.local to work was to execute the following as root:
Code:
ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/multi-user.target.wants/rc-local.service
Then I wrote the /etc/rc.d/rc.local file (the first line being #!/bin/sh like yours) and make that file executable:
Code:
chmod 755 /etc/rc.d/rc.local
I then enabled it with:
Code:
systemctl enable rc-local.service
so that it ran on each boot up. In my case I used the rc.local file to create some links in /dev and make a /dev/dsp and it all worked. Now, when I ask systemctl the status of rc-local.service I get:
Quote:
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled)
Active: active (exited) since Thu, 02 Aug 2012 08:47:08 +1000; 1h 17min ago
Process: 721 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/rc-local.service
and everything works as intended from my point of view.

From your first quote it looks as if you are trying to make the rc.local file executable from within the rc.local file itself. I can't see how this can work. If the rc.local file is not executable when the operating system first sees it (without looking into its contents), it ignores it. Rather, the rc.local file should be made executable by your chmod command before the operating system tries to execute it. I would remove the chmod and ln commands from your rc.local file, keep the rest of it, and try the above approach which I have outlined to see how that goes, bearing in mind that the commands in your rc.local file have to be workable as well on your system for it all to work. ben.
Reply With Quote
  #3  
Old 2nd August 2012, 02:24 AM
Serophis Offline
Registered User
 
Join Date: Jun 2012
Location: Norway
Posts: 43
linuxfirefox
Re: Can't get rc.local to work

Following your suggestions didn't work at first. Then I examined the commands I had put into rc.local and noticed that 'hdparm' didn't work. A quick 'yum install hdparm' fixed that, following with a 'systemctl restart rc-local.service' got rc.local working fine.

I really am a noob when it comes to Linux, lol!

Thanks for the help.
Reply With Quote
Reply

Tags
rclocal, work

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batavi wont work on my local server... markx Servers & Networking 0 14th February 2011 12:43 PM
can't get sendmail to work for local mail akaisora Servers & Networking 0 21st October 2010 02:05 AM
[Help]Local Site not work Felipesm Installation and Live Media 2 15th July 2010 04:23 PM
Local printer Epson EPL-6200L doesn't work on FC2 fdr Hardware & Laptops 3 22nd August 2007 07:06 PM
Getting yum to work with local files in FC4. xode EOL (End Of Life) Versions 9 9th June 2006 12:03 AM


Current GMT-time: 23:54 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat