You are not logged in.

#1 2012-11-18 12:57:06

DarioP
Member
From: Geneva
Registered: 2011-01-05
Posts: 165

How to move the custom hooks in /etc/rc.d/functions.d to systemd

I have a few scripts placed in /etc/rc.d/functions.d that were launched during the boot process.

Now I moved to systemd but I have not found any documentation about how to implement those hooks in the new boot process. As far as I got I need to write customs .service files, but again I lack of infos about how..

Can anybody teach me a bit about this or link some documentation?

Many thanks

Offline

#2 2012-11-18 14:00:44

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to move the custom hooks in /etc/rc.d/functions.d to systemd

The systemd wiki page has an introduction to that topic, the man pages have a lot more info, and there are numerous official examples to use for guidance in /usr/lib/systemd/system.

You could also post your existing scripts here, in case people feel like suggesting specific solutions.

Offline

#3 2012-11-18 18:05:26

DarioP
Member
From: Geneva
Registered: 2011-01-05
Posts: 165

Re: How to move the custom hooks in /etc/rc.d/functions.d to systemd

ok, after many searches I realized that

# man systemd.service

prints everything one needs to know about the entries of .service files.

For a quite big collection of examples one can also look here:
https://wiki.archlinux.org/index.php/Systemd/Services

Offline

#4 2012-11-19 22:06:40

DarioP
Member
From: Geneva
Registered: 2011-01-05
Posts: 165

Re: How to move the custom hooks in /etc/rc.d/functions.d to systemd

Ok, I think I need some help here.

I want to call the acpi_call kernel module to switch off the nvidia discrete card at boot. Usually I did that with

# echo '\_SB.PCI0.PEG1.GFX0._ON' > /proc/acpi/call

I wrote the following /etc/systemd/system/nvidia_off.service:

[Unit]
Description=acpi_call to switch off nvidia discrete graphic

[Service]
Type=simple
ExecStart=/bin/echo '\_SB.PCI0.PEG1.GFX0._OFF' > /proc/acpi/call
ExecStop=/bin/echo '\_SB.PCI0.PEG1.GFX0._ON' > /proc/acpi/call

[Install]
WantedBy=multi-user.target

but testing with:

#systemctl start nvidia_off.service
#systemctl stop nvidia_off.service

seems no effective. No output is produced but there is no effect on the power consumption which should be several watts lower.

I also take a look at sysctl but it seems to control only /proc/sys/anything while my module is under /proc/acpi

Any suggestion?

thanks in advance

Offline

Board footer

Powered by FluxBB