[SOLVED] What performs rc.local role in systemd?

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[SOLVED] What performs rc.local role in systemd?

Postby ghmitch » Apr 15th, '13, 06:59

I need to run hdparm on boot. All advice I have seen so far is to use rc.local. But rc.local is gone now. What is the correct way to do this with systemd?
Last edited by ghmitch on Apr 15th, '13, 18:38, edited 1 time in total.
ghmitch
 
Posts: 325
Joined: Mar 30th, '11, 03:05
Location: Eureka California USA

Re: What performs rc.local role in systemd?

Postby jkerr82508 » Apr 15th, '13, 11:40

Supposedly, you can just create /etc/rc.d/rc.local, make it executable and activate the systemd rc-local service:
Code: Select all
systemctl enable rc-local.service
(I've not done this on current cauldron and so don't know if it still actually works.)
I believe that the systemd replacement for rc.local would be a unit file or files as described in
Code: Select all
man systemd.unit

Jim

Edit: As pointed out later in this thread, the rc-local.service should not be enabled manually. It is launched automatically by systemd on boot.
Last edited by jkerr82508 on Jul 19th, '13, 19:47, edited 1 time in total.
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: What performs rc.local role in systemd?

Postby rc10b » Apr 15th, '13, 12:18

I can confirm that this method worked for me.

jkerr82508 wrote:Supposedly, you can just create /etc/rc.d/rc.local, make it executable and activate the systemd rc-local service:
Code: Select all
systemctl enable rc-local.service


Steve
rc10b
 
Posts: 70
Joined: Mar 30th, '11, 12:07
Location: UK - Hampshire

[SOLVED] Re: What performs rc.local role in systemd?

Postby ghmitch » Apr 15th, '13, 18:37

Thanks all! But actually its just as well I didn't know how to do it. And its a good thing the config file DIDN'T work! The ONLY setting I was concerned about was enabling multi-sector read which reduces cpu overhead because it looked like a no brainer. Interestingly there are no warnings in the hdparm online manual about enabling multi-sector reads. There are also no specific libata warnings in the harddrive config file in /etc/sysconfig. Fortunately, before going further to program something into the system, I manually attemped trying it with one small inexpensive drive as a guinea pig. The result? The following message from hdparm -> "Use of -m is VERY DANGEROUS. Only the old IDE drivers work correctly with -m with kernels up to at least 2.6.29. libata drives may fail and get hung if you set this flag. Please supply the --yes-i-know-what-i-am-doing flag if you really want this. Program aborted." This is probably related to some intrinsic conflict with properly executing NCQ support. Well ... that little warning feature saved me an unneeded headache. Its easy to forget that one does not only need drive support for a feature, but also kernel module support! And what doesn't run on libata these days? For SURE there should be a warning on this feature in the harddrive config file regarding libata supported drives! Hopefully this whole thing will be revisited when harddrive config gets integrated into systemd. - George
ghmitch
 
Posts: 325
Joined: Mar 30th, '11, 03:05
Location: Eureka California USA

Re: What performs rc.local role in systemd?

Postby waferhead » May 24th, '13, 05:24

rc10b wrote:I can confirm that this method worked for me.

jkerr82508 wrote:Supposedly, you can just create /etc/rc.d/rc.local, make it executable and activate the systemd rc-local service:
Code: Select all
systemctl enable rc-local.service


Steve


This worked for me as well,
...far easier that attempting to create custom systemd unit files just to run chgrp and chown on /run/lock at boot so serial file locking can be used by users.
The rc-local serice is on by default in mga3, but you have to create the /etc/rc.d/rc.local and make it executable.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: [SOLVED] What performs rc.local role in systemd?

Postby morgano » May 24th, '13, 11:17

I too want to run rc.local, to optimise for SSD and set power parameter for graphics.
But it fails:
Code: Select all
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument

What argument is invalid, why?... Anyhow it looks like it somewhat worked:
Code: Select all
# systemctl disable rc-local.service
rm '/etc/systemd/system/multi-user.target.wants/rc-local.service'
# systemctl disable rc-local.service
(no output)
And again:
Code: Select all
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument
# systemctl disable rc-local.service
rm '/etc/systemd/system/multi-user.target.wants/rc-local.service'
# systemctl disable rc-local.service
(no output)
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument

I left it there, but it seems it still do not execute /etc/rc.d/rc.local
And yes i have set it executable, own by root.
System is mga3-64 fully updated
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1488
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

rc.local

Postby martint2 » May 24th, '13, 18:54

I like to use rc.local to openvpn and set some information on tun and allow ip4_forwarding.

in mga 2 I did this in rc.local

this does not appear to work in mga3

where should I start to look?

Martin
martint2
 
Posts: 19
Joined: May 24th, '13, 09:23

Re: rc.local

Postby leuhmanu » May 24th, '13, 20:01

Hello, something like than could help you: http://superuser.com/questions/278396/s ... c-rc-local
Help the bugsquad !
User avatar
leuhmanu
 
Posts: 71
Joined: Mar 16th, '11, 00:21
Location: Alsace, France

Re: rc.local

Postby martint2 » May 24th, '13, 21:06

Leuhmanu, sounds like it (from cursory reading)- I'll check it out tomorrow and close if solved

Thank you

Martin
martint2
 
Posts: 19
Joined: May 24th, '13, 09:23

Re: rc.local

Postby leuhmanu » May 25th, '13, 00:12

and in fact you could have used the search function in this forum: viewtopic.php?f=15&t=4734

please mark the thread as solved if it's the case
Last edited by doktor5000 on May 25th, '13, 01:34, edited 1 time in total.
Reason: fixed link
Help the bugsquad !
User avatar
leuhmanu
 
Posts: 71
Joined: Mar 16th, '11, 00:21
Location: Alsace, France

Re: [SOLVED] What performs rc.local role in systemd?

Postby doktor5000 » May 25th, '13, 01:35

Merged the topics.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18041
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] What performs rc.local role in systemd?

Postby morgano » May 27th, '13, 00:30

DOH!
I had put my rc.local in /etc/rc.d/ instead of just /etc/ :oops:
Now it works :lol:
(I also checked it also work to change thea paths set in /etc/systemd/system/rc-local.service instead)

Well rc.local is definately executed now, despite I still get the same error when I disable and then enable it:
Code: Select all
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument


EDIT: Web search finds I am not alone but it seem very spuroius. I drop it here as it do what i need.
Last edited by morgano on May 27th, '13, 01:14, edited 1 time in total.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1488
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: [SOLVED] What performs rc.local role in systemd?

Postby waferhead » May 27th, '13, 00:44

Mine's working in /etc/rc.d/rc.local but also giving errors

As it's a very simple script it probably lacks some info systemd is looking for.

Tried using some othe the other things in the /etc/rc.d directory as templates, didn't seem to help.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: rc.local

Postby waferhead » May 27th, '13, 00:50

martint2 wrote:Leuhmanu, sounds like it (from cursory reading)- I'll check it out tomorrow and close if solved

Thank you

Martin


I'm not entirely sure it's fully "solved" due to the errors from systemd.
"Works", yes, solved... probably not 100% yet.
It would be very nice to understand the proper method.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: [SOLVED] What performs rc.local role in systemd?

Postby sander85 » May 27th, '13, 12:20

waferhead wrote:Mine's working in /etc/rc.d/rc.local but also giving errors


Can you please show us the errors. Just telling it's giving errors doesn't help much..
Stand for something, or you will fall for nothing.
-- Richard Stallman
User avatar
sander85
 
Posts: 88
Joined: Jan 28th, '12, 20:41
Location: Estonia

Re: [SOLVED] What performs rc.local role in systemd?

Postby waferhead » May 27th, '13, 19:38

sander85 wrote:
waferhead wrote:Mine's working in /etc/rc.d/rc.local but also giving errors


Can you please show us the errors. Just telling it's giving errors doesn't help much..



Same error morgano posted
Code: Select all
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument


my rc.local is quite simple
Code: Select all
#!/bin/sh
chgrp uucp /run/lock
chmod 775 /run/lock


...Done simply so I can add the user to the uucp group and allow access to serial lockfiles.
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: [SOLVED] What performs rc.local role in systemd?

Postby sander85 » May 27th, '13, 20:06

waferhead wrote:Same error morgano posted
Code: Select all
# systemctl enable rc-local.service
Failed to issue method call: Invalid argument


You don't have to enable this service. It's started when /etc/rc.d/rc.local is executable.
Stand for something, or you will fall for nothing.
-- Richard Stallman
User avatar
sander85
 
Posts: 88
Joined: Jan 28th, '12, 20:41
Location: Estonia

Re: [SOLVED] What performs rc.local role in systemd?

Postby waferhead » May 27th, '13, 21:04

I understand that (and it does work)
If the msgs are normal if trying to enable the service, that's fine too.

Just making sure that I'm not missing an include or such.
Last edited by doktor5000 on May 27th, '13, 22:55, edited 1 time in total.
Reason: removed fullquote
waferhead
 
Posts: 171
Joined: Jun 11th, '11, 06:36

Re: [SOLVED] What performs rc.local role in systemd?

Postby doktor5000 » May 27th, '13, 22:56

Please don't use the quote button when you want to use the reply button instead!
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18041
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron