Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Systemd not starting services on boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ub1quit33
n00b
n00b


Joined: 24 May 2013
Posts: 16

PostPosted: Mon Sep 02, 2013 5:28 pm    Post subject: Systemd not starting services on boot? Reply with quote

It would appear that systemd does not start my custom written service files at boot time, even when enabled. My default target is graphical, and I'll provide a couple samples of my service files below. This is a major issue, as it's preventing my networking and LVM from coming up at boot time, so in advance, I greatly appreciate any helpers anyone can give here.

lvm.service
Code:
[Unit]
Description=LVM logical volumes
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
Before=basic.target shutdown.target

[Service]
Type=oneshot
ExecStart=/sbin/lvm pvscan
ExecStart=/sbin/lvm vgscan --mknodes
ExecStart=/sbin/lvm vgchange -ay
RemainAfterExit=yes

[Install]
WantedBy=sysinit.target


network.service
Code:
[Unit]
Description=Wireless inerface
Before=basic.target shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -i wlp2s6 -P /var/run/wpa_supplicant.pid -B
ExecStart=/sbin/dhcpcd wlp2s6
ExecStart=/bin/ip addr add 192.168.1.1/24 dev enp2s3
ExecStart=/bin/ip link set enp2s3 up
ExecStart=/sbin/iptables -t nat -A POSTROUTING -o wlp2s6 -j MASQUERADE
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
# I have previously tried here WantedBy=network.target


The service files themselves start up fine when activated manually. They both do exactly what they were intended to. They simply do not activate at boot time, although the output below shows them both as enabled.

Code:
backup01 rules.d # systemctl status lvm
lvm.service - Activate lvm logical volumes
   Loaded: loaded (/etc/systemd/system/lvm.service; enabled)
backup01 rules.d # systemctl status network
network.service - Wireless inerface
   Loaded: loaded (/etc/systemd/system/network.service; enabled)
Back to top
View user's profile Send private message
BobWya
Apprentice
Apprentice


Joined: 12 Aug 2012
Posts: 228
Location: Cambridge,UK

PostPosted: Sun Sep 15, 2013 12:12 am    Post subject: Reply with quote

I presume you've checked...
Code:
journactl --unit lvm.service


I am still a noob at systemd myself... But I had a look at your unit definitions... I cannot see an obvious problem... I have idea what is wrong - for an example take a lot at the code for: NetworkManager-wait-online.service and you will set what I mean (i.e. you have not specified enough syncronisation conditions to trigger the network.service you have created)... I find the whole synchronisation thingy a bit of BF myself... :roll:

I would suggest cross-posting on the systemd-devel mailing list (which is awesome btw) as Lennart Poettering hangs out there...
You'll only hear the tumbleweed blowing here - as systemd is not very integrated in Gentoo (vs. say Arch or OpenSUSE)...

Just my $0.02
Bob
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum