Page 1 of 1

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

PostPosted: Apr 15th, '13, 06:59
by ghmitch
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?

Re: What performs rc.local role in systemd?

PostPosted: Apr 15th, '13, 11:40
by jkerr82508
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.

Re: What performs rc.local role in systemd?

PostPosted: Apr 15th, '13, 12:18
by rc10b
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

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

PostPosted: Apr 15th, '13, 18:37
by ghmitch
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

Re: What performs rc.local role in systemd?

PostPosted: May 24th, '13, 05:24
by waferhead
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.

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

PostPosted: May 24th, '13, 11:17
by morgano
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

rc.local

PostPosted: May 24th, '13, 18:54
by martint2
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

Re: rc.local

PostPosted: May 24th, '13, 20:01
by leuhmanu
Hello, something like than could help you: http://superuser.com/questions/278396/s ... c-rc-local

Re: rc.local

PostPosted: May 24th, '13, 21:06
by martint2
Leuhmanu, sounds like it (from cursory reading)- I'll check it out tomorrow and close if solved

Thank you

Martin

Re: rc.local

PostPosted: May 25th, '13, 00:12
by leuhmanu
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

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

PostPosted: May 25th, '13, 01:35
by doktor5000
Merged the topics.

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

PostPosted: May 27th, '13, 00:30
by morgano
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.

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

PostPosted: May 27th, '13, 00:44
by waferhead
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.

Re: rc.local

PostPosted: May 27th, '13, 00:50
by waferhead
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.

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

PostPosted: May 27th, '13, 12:20
by sander85
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..

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

PostPosted: May 27th, '13, 19:38
by waferhead
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.

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

PostPosted: May 27th, '13, 20:06
by sander85
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.

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

PostPosted: May 27th, '13, 21:04
by waferhead
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.

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

PostPosted: May 27th, '13, 22:56
by doktor5000
Please don't use the quote button when you want to use the reply button instead!