[Solved] systemd-hostnamed.service broken in systemd 212?
Can someone confirm by checking
hostnamectl status
and
systemctl --failed
Thanks!
Last edited by gedgon (2014-04-03 20:30:03)
teateawhy wrote:Works for me.
Hmm, interesting. In v.212 systemd-hostnamed.service failing for me, and hostnamectl timing out. Works fine after downgrading.
Edit: Problem caused by wrong /var/tmp permission. Thanks, teateawhy.
Last edited by gedgon (2014-04-03 20:29:47)
Similar Messages
-
Systemd-hostnamed.service fails to start
I'm finding the systemd-hostnamed.service isnt working
$ sudo systemctl --state=failed
[sudo] password for kevdog:
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-hostnamed.service loaded failed failed Hostname Service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
$ sudo systemctl status systemd-hostnamed.service
● systemd-hostnamed.service - Hostname Service
Loaded: loaded (/usr/lib/systemd/system/systemd-hostnamed.service; static)
Active: failed (Result: timeout) since Tue 2014-12-16 23:11:36 CST; 10min ago
Docs: man:systemd-hostnamed.service(8)
man:hostname(5)
man:machine-info(5)
http://www.freedesktop.org/wiki/Software/systemd/hostnamed
Main PID: 4584
Dec 16 23:08:35 orphan systemd[1]: systemd-hostnamed.service start operation timed out. Terminating.
Dec 16 23:10:06 orphan systemd[1]: systemd-hostnamed.service stop-final-sigterm timed out. Killing.
Dec 16 23:11:36 orphan systemd[1]: systemd-hostnamed.service still around after final SIGKILL. Entering failed mode.
Dec 16 23:11:36 orphan systemd[1]: Failed to start Hostname Service.
Dec 16 23:11:36 orphan systemd[1]: Unit systemd-hostnamed.service entered failed state.
Dec 16 23:11:36 orphan systemd[1]: systemd-hostnamed.service failed.
I found this addressed in this topic:
https://github.com/ev3dev/ev3dev/issues/189
Within this page they state:
Confirmed that removing PrivateNetwork=yes from the service file works as a workaround. Maybe need to enable CONFIG_NAMESPACES=y and CONFIG_NET_NS=y kernel modules
I removed the PrivateNetwork=yes from the service file, however this didn't seem to work. I did not enable the kernel modules. I am currently running the following kernel: 3.17.6-1-ARCH
ThanksI'm finding the systemd-hostnamed.service isnt working
$ sudo systemctl --state=failed
[sudo] password for kevdog:
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-hostnamed.service loaded failed failed Hostname Service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
$ sudo systemctl status systemd-hostnamed.service
● systemd-hostnamed.service - Hostname Service
Loaded: loaded (/usr/lib/systemd/system/systemd-hostnamed.service; static)
Active: failed (Result: timeout) since Tue 2014-12-16 23:11:36 CST; 10min ago
Docs: man:systemd-hostnamed.service(8)
man:hostname(5)
man:machine-info(5)
http://www.freedesktop.org/wiki/Software/systemd/hostnamed
Main PID: 4584
Dec 16 23:08:35 orphan systemd[1]: systemd-hostnamed.service start operation timed out. Terminating.
Dec 16 23:10:06 orphan systemd[1]: systemd-hostnamed.service stop-final-sigterm timed out. Killing.
Dec 16 23:11:36 orphan systemd[1]: systemd-hostnamed.service still around after final SIGKILL. Entering failed mode.
Dec 16 23:11:36 orphan systemd[1]: Failed to start Hostname Service.
Dec 16 23:11:36 orphan systemd[1]: Unit systemd-hostnamed.service entered failed state.
Dec 16 23:11:36 orphan systemd[1]: systemd-hostnamed.service failed.
I found this addressed in this topic:
https://github.com/ev3dev/ev3dev/issues/189
Within this page they state:
Confirmed that removing PrivateNetwork=yes from the service file works as a workaround. Maybe need to enable CONFIG_NAMESPACES=y and CONFIG_NET_NS=y kernel modules
I removed the PrivateNetwork=yes from the service file, however this didn't seem to work. I did not enable the kernel modules. I am currently running the following kernel: 3.17.6-1-ARCH
Thanks -
[SOLVED] systemd-tmpfiles-clean takes a very long time to run
I've been having an issue for a while with systemd-tmpfiles-clean.service taking a very long time to run. I've tried to just ignore it, but it's really bothering me now.
Measuring by running:
# time systemd-tmpfiles --clean
systemd-tmpfiles --clean 11.63s user 110.37s system 10% cpu 19:00.67 total
I don't seem to have anything funky in any tmpfiles.d:
# ls /usr/lib/tmpfiles.d/* /run/tmpfiles.d/* /etc/tmpfiles.d/* | pacman -Qo -
ls: cannot access /etc/tmpfiles.d/*: No such file or directory
error: No package owns /run/tmpfiles.d/kmod.conf
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf is owned by gvfs 1.20.1-2
/usr/lib/tmpfiles.d/lastlog.conf is owned by shadow 4.1.5.1-9
/usr/lib/tmpfiles.d/legacy.conf is owned by systemd 212-3
/usr/lib/tmpfiles.d/libvirt.conf is owned by libvirt 1.2.4-1
/usr/lib/tmpfiles.d/lighttpd.conf is owned by lighttpd 1.4.35-1
/usr/lib/tmpfiles.d/lirc.conf is owned by lirc-utils 1:0.9.0-71
/usr/lib/tmpfiles.d/mkinitcpio.conf is owned by mkinitcpio 17-1
/usr/lib/tmpfiles.d/nscd.conf is owned by glibc 2.19-4
/usr/lib/tmpfiles.d/postgresql.conf is owned by postgresql 9.3.4-1
/usr/lib/tmpfiles.d/samba.conf is owned by samba 4.1.7-1
/usr/lib/tmpfiles.d/slapd.conf is owned by openldap 2.4.39-1
/usr/lib/tmpfiles.d/sudo.conf is owned by sudo 1.8.10.p2-1
/usr/lib/tmpfiles.d/svnserve.conf is owned by subversion 1.8.8-1
/usr/lib/tmpfiles.d/systemd.conf is owned by systemd 212-3
/usr/lib/tmpfiles.d/systemd-nologin.conf is owned by systemd 212-3
/usr/lib/tmpfiles.d/tmp.conf is owned by systemd 212-3
/usr/lib/tmpfiles.d/uuidd.conf is owned by util-linux 2.24.1-6
/usr/lib/tmpfiles.d/x11.conf is owned by systemd 212-3
How do I debug why it is taking so long? I've looked in man 8 systemd-tmpfiles and on google, hoping to find some sort of --dubug option, but there seems to be none.
Is it some how possible to get a list of the directories that it looks at when it runs?
Anyone have any suggestions on how else to fix this.
Anyone else have this issue?
Thanks,
Gary
Last edited by garyvdm (2014-05-08 18:57:43)Thank you very much falconindy. SYSTEMD_LOG_LEVEL=debug helped my find my issue.
The cause of the problem was thousands of directories in /var/tmp/ created by a test suite with a broken clean up method. systemd-tmpfiles-clean was recursing through these, but not deleting them. -
[SOLVED] defect dbus service, systemd is unable to create socket
Hi,
I am experiencing serious problems with systemd & dbus.
I want to setup a gateway in a KVM VM, all was working fine till i applied my shorewall config & set to autostart (systemctl enable shorewall).
If I reboot the machine after this step one or two times, then I get a broken dbus service.
What I did than: reinstalled archlinux again (x86_x64) and setup same -> got issue again.
installed arch linux as x86 and setup same -> issue again
installed arch as x86 and configured nothing else shorewall and got this issue again after maximum of two reboots.
i found in log:
Feb 13 15:45:56 pactor systemd[1]: Failed to open private bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
I've checked this directory by hand and found that only /var/run is existing. /var/run/dbus is already not existing.
logs:
journalctl -b: http://nopaste.info/685f4c6192.html
-be aware of systemd-logind, this needs dbus and i experience same problem with other services which require dbus as dnsmasq
root@pactor ~]# systemctl status dbus
dbus.service - D-Bus System Message Bus
Loaded: loaded (/usr/lib/systemd/system/dbus.service; static)
Active: active (running) since Mi 2013-02-13 15:45:56 CET; 9min ago
Main PID: 169 (dbus-daemon)
CGroup: name=systemd:/system/dbus.service
└─169 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
[root@pactor ~]# systemctl status dbus.socket
dbus.socket - D-Bus System Message Bus Socket
Loaded: loaded (/usr/lib/systemd/system/dbus.socket; static)
Active: active (running) since Mi 2013-02-13 15:45:56 CET; 9min ago
Feb 13 15:45:56 pactor systemd[1]: Listening on D-Bus System Message Bus Socket.
systemd-logind.service - Login Service
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: activating (start) since Mi 2013-02-13 16:00:56 CET; 48s ago
Docs: man:systemd-logind.service(8)
man:logind.conf(5)
http://www.freedesktop.org/wiki/Software/systemd/multiseat
Main PID: 338 (systemd-logind)
CGroup: name=systemd:/system/systemd-logind.service
└─338 /usr/lib/systemd/systemd-logind
Feb 13 16:00:56 pactor systemd[1]: Failed to start Login Service.
Feb 13 16:00:56 pactor systemd[1]: Unit systemd-logind.service entered failed state
Feb 13 16:00:56 pactor systemd[1]: systemd-logind.service holdoff time over, scheduling restart.
Feb 13 16:00:56 pactor systemd[1]: Stopping Login Service...
Feb 13 16:00:56 pactor systemd[1]: Starting Login Service...
installed packages: http://nopaste.info/1d1be9adad.html
shorewall config: shorewall_conf.tar
Last edited by debijan (2013-02-20 20:13:47)oh man... found the reason due to help of some guys on systemd irc... big thx to falconindy and alxchk.
shorewall's SUBSYSLOCK option in shorewall.conf is by default set to /var/lock/shorewall.
but the arch wiki point that it should be set to /var/run: https://wiki.archlinux.org/index.php/Router
definitely wrong! that deletes the /var/run symlink and created a directory intstead.
to set the SUBSYSLOCK on default is working like a charm.
look also for this: https://bbs.archlinux.org/viewtopic.php?id=151285
could somebody modify the wiki in the meantime, i will hold this thread on -not-solved in the meantime
edit:/ oh man this wrong info in wiki did cost me a lot of time :-/
Last edited by debijan (2013-02-13 22:09:35) -
[SOLVED]systemd-tmpfiles-setup.service failure
Hi guys,
I just reinstalled arch with the following partitions:
[root@arch_vinnom vinnom]# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.0
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): BD3CA679-FA08-4F60-9BAD-B845DE9FF7EB
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02 BIOS
2 4096 52432895 25.0 GiB 8300 ROOT
3 52432896 53481471 512.0 MiB 8300 BOOT
4 53481472 74452991 10.0 GiB 8300 TMP
5 74452992 95424511 10.0 GiB 8300 VAR
6 95424512 602935295 242.0 GiB 8300 HOME
7 602935296 625142414 10.6 GiB 8200 SWAP
The problem is that tmpfs is mounted at '/tmp' through '/usr/lib/systemd/system/tmp.mount'
# This file is part of systemd.
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Temporary Directory
Documentation=man:hier(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime
Because of this, I'm always getting:
● systemd-tmpfiles-setup.service - Create Volatile Files and Directories
Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Dom 2015-05-03 03:29:58 BRT; 27min ago
Docs: man:tmpfiles.d(5)
man:systemd-tmpfiles(8)
Process: 278 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=1/FAILURE)
Main PID: 278 (code=exited, status=1/FAILURE)
Then I tried to change '/tmp' to '/run/tmpfs', folder that I created for this, using tmpfs wiki as reference.
# This file is part of systemd.
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Temporary Directory
Documentation=man:hier(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/run/tmpfs
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
[Mount]
What=tmpfs
Where=/run/tmpfs
Type=tmpfs
Options=mode=1777,strictatime,nodev,nosuid,size=1536M
But the error persists. What I'm missing?
Last edited by vinnom (2015-05-03 16:51:38)ooo wrote:Couldn't you just mask the tmp.mount service? (as mentioned in the wiki page you linked)
Then your /tmp partition would be mounted according to your fstab
Raynman wrote:
The tmp.mount generated from your fstab should override the tmp.mount in /usr/lib/systemd/system. You say
The problem is that tmpfs is mounted at '/tmp' through '/usr/lib/systemd/system/tmp.mount'
If that is true (could you show output of mount and your fstab?) that is worth investigating.
However, your original problem seems to be that systemd-tmpfiles-setup.service fails. If something is wrong with your mounts, that could be related, but it might very well be something else. Is there any more information in the journal to indicate why the service fails (maybe even mentioning a tmpfiles.d config file that is responsible)? Did you create any config files for tmpfiles.d yourself?
Sorry guys, I tried to be concise, but ended up that I didn't make myself clear.
My '/tmp' is mounting fine as it takes priority over systemd. In fact, what I wanted to say is that '/tmp' mounts fine, systemd tried to mount tmpfs at '/tmp' and fails and I want to point tmpfs to mount at '/run/tmpfs' which I created for this, but just editing '/usr/lib/systemd/system/tmp.mount' didn't solve.
As for journalctl, it repeats several times this message:
Mai 02 22:43:32 arch_vinnom systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE
Mai 02 22:43:32 arch_vinnom systemd[1]: Failed to start Create Volatile Files and Directories.
Mai 02 22:43:32 arch_vinnom systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state.
Mai 02 22:43:32 arch_vinnom systemd[1]: systemd-tmpfiles-setup.service failed.
foutrelis wrote:
Depending on how your '/var' file system is created/mounted, you might need to enable ACL on it:
https://wiki.archlinux.org/index.php/Sy … rt_at_boot
hmm
I created my /var during arch installation, with mkfs.reiserfs.
Using
tune2fs -l /dev/sdXY | grep "Default mount options:"
To check if acl was already enabled, I got:
[root@arch_vinnom vinnom]# tune2fs -l /dev/sda5 | grep "Default mount options:"
tune2fs: Bad magic number in super-block while trying to open /dev/sda5
Couldn't find valid filesystem superblock.
Then I searched a bit and noted that reiserfs isn't compatible with acl =/
Last edited by vinnom (2015-05-03 15:12:18) -
[SOLVED] systemd adsl service does not start
After the today's upgrade of my system I get lines like this in my journal, as the adsl service does not want to start.
# router systemd[522]: Failed at step EXEC spawning /usr/sbin/pppoe-start: No such file or directory
The problem is, that pppoe-start is in /usr/bin/ and not in /usr/sbin. According to pacman (pacman-Ql rp-pppoe) /usr/bin/ is the correct location.
I really don't know, why systemd is trying to launch it, because even the service file (/usr/lib/systemd/system/adsl.service) points to the correct location.
[Unit]
Description=ADSL Deamon
[Service]
Type=forking
ExecStart=/usr/bin/pppoe-start
ExecStop=/usr/bin/pppoe-stop
[Install]
WantedBy=multi-user.target
The service is launching and stopping with pppoe-start and pppoe-stop.
When launched, it also shuts down fine when stopping it by
systemctl stop adsl
Why the hell is it trying to launch from /usr/sbin/?
Last edited by scar (2013-06-04 13:07:23)It goes definitely against any logic.
The service file looks good, but I've copied it to /usr/lib/systemd/system/bdsl.service. Same contents - and the new one launches succesfully.
I've deleted the original ...adsl.service file, verified that it disappeared, copied it back from the new bdsl.service file, and it still does not launch.
[EDIT]
I've erased the drive, restored the system from a 1 week old backup, started it - everything worked. Then I'v updated the whole system, including the rp-pppoe package, and the adsl service is failing again.
Downgrading solves the problem. Should I file a bug report?
Last edited by scar (2013-06-01 10:14:41) -
[SOLVED] systemd and rc-local.service
So, today i decided to try a pure systemd system by migrating my old installation.
The first problem i faced comes from rc-local.service.
I followed this:
https://wiki.archlinux.org/index.php/Sy … s#rc.local
and created an identical rc-local.service:
/etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=oneshot
ExecStart=/etc/rc.local
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
...made it executable and enabled the service via
systemctl enable rc-local.service
The problem comes when i issue:
systemctl --system daemon-reload
systemctl start rc-local.service
Here the prompt hangs forever.
..so i reeboted and automagically "Something" of my rc.local has been executed.
What has been left out was a subscript launched in background from my rc.local.
While in the past my working rc.local executed a script:
checkmounts.sh & #<-this loops forever
...and in ps -ef|grep checkmounts i got it listed, now with systemd i haven't it anymore.
...note that to debug issues i echoed several "marks" into a text file, and i'm sure that
rc.local has been executed till the end and systemctl status reports no errors at all.
So the question are:
1) why can't i start rc-local from terminal via sysctl and it works (sort of) if i reboot?
2) why a script executed from rc.local in background doesn't work?
Last edited by kokoko3k (2012-08-27 15:43:35)I already tried that with the same results.
Now i found that removing StandardInput=tty works and solved both of the issues (at least issuing manual startups).
So this:
[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=oneshot # is forking instead of oneshot needed here?
ExecStart=/etc/rc.local
TimeoutSec=0
#StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Works really well for me, exactly like in the past.
Plus, i can see all running child processess via systemctl status rc-local.service
If someone thinks this is wrong for seome reason i'll NOT update the wiki page.
--EDIT
Works well after a reboot too, and changing Type= to fork make just fork, parallelizing the boot (kdm+kde for me)
Last edited by kokoko3k (2012-09-13 13:43:38) -
[SOLVED]Systemd Tmpfile Setup Service Fails
I'm not sure what version this began but I'm using systemd 185-1 and systemd-arch-units 20120606-4. Service just fails to start. Is this fixable?
└╼ $ systemctl status systemd-tmpfiles-setup.service
systemd-tmpfiles-setup.service - Recreate Volatile Files and Directories
Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
Active: failed (Result: exit-code) since Fri, 22 Jun 2012 04:22:15 -0400; 36s ago
Docs: man:tmpfiles.d(5)
Process: 931 ExecStart=/usr/bin/systemd-tmpfiles --create --remove (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/systemd-tmpfiles-setup.service
Last edited by Hspasta (2012-06-23 04:31:05)swanson wrote:Check fstab and comment out the tmp there.
Did and didn't help.
WorMzy wrote:
Do you have any aur/custom-made packages that put *.conf files in /usr/lib/tmpfiles.d or /usr/local/lib/tmpfiles.d?
Does the system journal have any more information about the failure?
Hm...I have a lot of stuff in /usr/lib/tmpfiles.d/
└╼ $ ls /usr/lib/tmpfiles.d/
total 44K
-rw-r--r-- 1 root root 30 Jun 4 16:12 console.conf
-rw-r--r-- 1 root root 29 May 27 00:29 consolekit.conf
-rw-r--r-- 1 root root 74 Jun 6 19:02 initscripts.conf
-rw-r--r-- 1 root root 719 Jun 4 16:12 legacy.conf
-rw-r--r-- 1 root root 61 Jun 16 01:28 lvm2.conf
-rw-r--r-- 1 root root 24 Jun 1 00:04 mpd.conf
-rw-r--r-- 1 root root 27 Jun 9 03:29 nscd.conf
-rw-r--r-- 1 root root 30 Jun 9 01:41 openssh.conf
-rw-r--r-- 1 root root 729 Jun 4 16:12 systemd.conf
-rw-r--r-- 1 root root 449 Jun 4 16:12 tmp.conf
-rw-r--r-- 1 root root 622 Jun 4 16:12 x11.conf
I feel like something in my system is broken... -
$ cat /etc/sysctl.d/99-sysctl.conf
# Protection from the SYN flood attack.
net.ipv4.tcp_syncookies = 1
# Disable packet forwarding.
net.ipv4.ip_forward = 0
# Tweak those values to alter disk syncing and swap behavior.
vm.vfs_cache_pressure = 1000
vm.swappiness = 0
# USB Speed
vm.dirty_ratio = 5
vm.dirty_background_ratio = 3
# KDE
fs.inotify.max_user_watches = 524288
$ cat /proc/sys/vm/dirty_ratio
10
$ cat /proc/sys/vm/dirty_background_ratio
5
but
$ cat /proc/sys/vm/swappiness
0
$ cat /proc/sys/vm/vfs_cache_pressure
1000
Only restarting of systemd-systct.service helps.
$ sudo systemctl restart systemd-sysctl.service
$ cat /proc/sys/vm/dirty_ratio
5
$ cat /proc/sys/vm/dirty_background_ratio
3
what am i doing wrong?
Solved with - % sudo chmod -x /usr/lib/pm-utils/power.d/laptop-mode
Last edited by Perfect Gentleman (2013-09-20 00:34:44)Perfect Gentleman wrote:Solved with - % sudo chmod -x /usr/lib/pm-utils/power.d/laptop-mode
A more permanent solution is to mask that file
mkdir -p /etc/pm/power.d
touch /etc/pm/power.d/laptop-mode
which will not get written on update or reinstall. (Not than an update to this package seems at all likely but just in case.) -
[SOLVED]systemd service doesn't play sound
I have a bash script which play via 'sox' a sound file. Something like this:
play someFile -t alsa -q
I set up a 'systemd --user' timer which calls this script at certain time. The timer is successfully called and the corresponding service is also successfully called and exits with SUCCESS code. The problem is that sound is not heared.
When the service is called manually from the bash with
systemctl start mySoundTimer.service
the sound is played OK.
The service file is as follows:
[Unit]
Description= A sound timer.
[Service]
Type=simple
ExecStart=/usr/bin/bash /path/to/my/script.sh
I tried several other combinations in ExecStart:
ExecStart=/usr/bin/bash -c /path/to/my/script.sh
ExecStart=/usr/bin/bash "-c /path/to/my/script.sh"
ExecStart=/usr/bin/bash -c "/path/to/my/script.sh"
No one is working. What can be the cause of the problem?
EDIT:
The cause of this is a different timing behaviour of systemd timer as compared to cron which I used before. (It seemingly takes into account the time of the last run and does not run again if it is called in less than the interval between runs specified in the timer file. And I tested the timer by setting the system date to several seconds before the timer's planned times.)
Last edited by nbd (2014-08-05 20:23:39)msthev wrote:$ man systemd.service
ExecStart=
Note that this setting does not directly support shell command
lines. If shell command lines are to be used they need to be passed
explicitly to a shell implementation of some kind. Example:
ExecStart=/bin/sh -c 'dmesg | tac'
Thanks, changing ExecStart line to
ExecStart=/bin/bash -c '/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness'
solved the issue. Though I can recall seeing ExecStart lines with direct shell commands.
Raynman wrote:
You should look at tmpfiles.d.
https://wiki.archlinux.org/index.php/Sy … rary_files
I'll do that, thanks! -
[solved] systemd services not starting at boot (or at all)
On my router, some systemd services fail to start at boot.
The services are :
adsl (pppoe connetction on the wan interface)
shorewall (funny again for a router)
logind (brings up only tty1, and not the others with a 'timeout' error)
adsl starts fine manually after booting up
the others don't work, I have to launch shorewall with the old sysvinit rc script (and it works)
I really don't know, what happened to logind...
Last edited by scar (2012-11-30 10:20:44)cups: avahi client failed
adsl: timeout (ppp0 running on eth0, the service did not found eth0)
shorewall: did not work by the systemctl command, only with the old rc script
I'm not sure if there was an error with logind, but I've had only tty1, not all the others (I have not touched /etc/inittab)
since this was a very old install (but up to date), I've decided to reinstall the whole thing,
Everything works
(But reinstalling does not solve any problem, it erases the problems...)
Last edited by scar (2012-11-30 10:21:20) -
[Solved] Systemd user service and timer dbus error
I have installed arch recently and added a few of my own services, for example the acpi_call commands and such. Now I want to create a systemd service that runs every 5 minutes and execute a script.
I searched a lot and I found that I must use timers. I got the thing with the timers working, but because my script has to do with a specific user, I want it to run only every 5 minutes when i am logged in as that user.
I tried to put the files in /etc/systemd/users, .config/local/users and all the possibilities but everytime i want to enable it, it says dbus connection refused.
Can somebody please provide me a way to execute a systemd service every 5 minutes while I am logged in as a specific user?
I did follow the wiki and created a dbus service and all. Everything works on that side but i can't enable my user service.
thanks!
Last edited by nopemopes (2015-03-25 11:10:06)jasonwryan wrote:
What errors are you getting? https://bbs.archlinux.org/viewtopic.php?id=57855
Not a Sysadmin issue, moving to NC...
sorry, didn't mean to be incomplete.
The error says "Failed to get D-Bus connection: Connection refused".
I did what the wiki said: Create the dbus files, enable them and such.
No i put my service files + timer in the places mentioned by the wiki but everytime i try to enable them, that error shows up.
systemctl status dbus gives me all good
dbus.service - D-Bus System Message Bus
Loaded: loaded (/usr/lib/systemd/system/dbus.service; static; vendor preset: disabled)
Active: active (running) since ma 2015-03-23 19:39:24 CET; 1h 18min ago
Docs: man:dbus-daemon(1)
Main PID: 246 (dbus-daemon)
CGroup: /system.slice/dbus.service
└─246 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
mrt 23 19:39:34 Jordy-Laptop dbus[246]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='...ervice'
mrt 23 19:39:34 Jordy-Laptop dbus[246]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1....ectory.
mrt 23 19:39:34 Jordy-Laptop dbus[246]: [system] Activating via systemd: service name='org.freedesktop.ModemManager1' unit='...ervice'
mrt 23 19:39:34 Jordy-Laptop dbus[246]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1....ectory.
mrt 23 19:39:39 Jordy-Laptop dbus[246]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='...ervice'
mrt 23 19:39:39 Jordy-Laptop dbus[246]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
mrt 23 19:47:01 Jordy-Laptop dbus[246]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='...ervice'
mrt 23 19:47:01 Jordy-Laptop dbus[246]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
mrt 23 20:51:38 Jordy-Laptop dbus[246]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='...ervice'
mrt 23 20:51:38 Jordy-Laptop dbus[246]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
that's the log for dbus and these are my files:
drive_sync.service
[Unit]
Description=Drive sync
[Service]
Type=simple
ExecStart=drive_script.sh
drive_sync.timer
[Unit]
Description=Drive sync
[Service]
Type=simple
ExecStart=drive_script.sh
these files are located in ~/.config/systemd/user
Last edited by nopemopes (2015-03-23 20:00:55) -
[SOLVED] systemd/User, starting a Dependent service
I am missing something simple here. I have two services. Once is dependent on the other.
I got the first service to start with:
$ cat ~/.config/systemd/user/[email protected]
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=https://github.com/syncthing/syncthing/wiki
After=network.target
[Service]
#User=%i
Environment=STNORESTART=yes
ExecStart=/usr/bin/syncthing -no-browser -logflags=0
Restart=on-failure
SuccessExitStatus=2 3 4
RestartForceExitStatus=3 4
[Install]
#WantedBy=multi-user.target
WantedBy=default.target
This autostarts upon logging in with i3 and gnome. No problem (now).
The problem I have is with the notifier/watcher:
$ cat ~/.config/systemd/user/[email protected]
[Unit]
Description=Syncthing Inotify File Watcher for %I
Documentation=https://github.com/syncthing/syncthing-inotify/blob/master/README.md
After=network.target [email protected]
[email protected]
[Service]
#User=%i
ExecStart=/usr/bin/syncthing-inotify -logflags=0
SuccessExitStatus=2
Restart=on-failure
ProtectSystem=full
ProtectHome=read-only
[Install]
#WantedBy=multi-user.target
WantedBy=default.target
Installed it into my namespace, like I did with the parent service:
$ systemctl --user enable [email protected]
On system startup/login, the service is "Dead (inactive)."
But, I can start it manually:
$ systemctl --user start [email protected]
And the status of the service shows it logging and working, picking up changes, etc.
I must be missing a configuration parameter in the service file.
Last edited by eduncan911 (2015-05-25 14:39:38)mauritiusdadd wrote:
Just a shot in the dark, but try to change the After= and Requires= lines in [email protected] to
After=network.target syncthing@%i.service
Requires=syncthing@%i.service
You know how you stay up late and everything you do right seems to be wrong?
When I ran:
systemctl status [email protected]
...it showed inactive (dead) and is the reason I made this thread.
Changed it to this:
systemctl --user status [email protected]
Allowed me to see it started. *head smack*
And btw, I tried "syncthing@%i.service" and it worked too! I reverted back to "[email protected]" to verify %i fixed it, but it started as well as before. So "%i" seems agnostic and would work as well. -
[solved] systemd service files don't allow quotes
Why is it not possible to use quotes in
ExecStart=
section of systemd service files?
For example, I can't use service file like this
[Unit]
Description=Pacman mirrorlist update
[Service]
Type=oneshot
ExecStart=wget -O /etc/pacman.d/mirrorlist.backup "https://www.archlinux.org/mirrorlist/?country=DE&country=NL&country=PL&protocol=http&ip_version=4" && cp /etc/pacman.d/mirrorlist.backup /etc/pacman.d/mirrorlist && reflector --verbose -l 50 -p http --sort rate --save /etc/pacman.d/mirrorlist
because systemd will not run it because of presence of quotes:
Feb 26 08:48:36 nanoBox systemd[1]: [/etc/systemd/system/reflector.service:7] Executable path is not absolute, ignoring: wget -O /etc/pacman.d/mirrorlist.backup "URL=http...
Feb 26 08:48:36 nanoBox systemd[1]: reflector.service lacks both ExecStart= and ExecStop= setting. Refusing.
I can remove quotes and then the service will run, but the URL parsed to the command will be cut in half, ie it will stop on the first "&" sign and only DE mirrors will be probed.
Is there some way around it other than creating a separate executable file and calling it from the service? I don't want to multiply unnecessary files if there's way around it.
Last edited by Lockheed (2015-02-26 09:37:25)Lockheed wrote:
Raynman wrote:"from command line" is you feeding a (command) string to a shell. Your assumption is that systemd will treat whatever you put in ExecStart exactly the same as your shell would.
Not "is" but "was". Disappearance of that assumption was precisely the reason of starting this thread.
I had to read this a few times, but I think you mean it as follows. You assumed you could copy from the shell to the service file and it would work the same way. Then you got an error (about the abolute path) so that assumption "disappeared". So far so good. But you didn't exactly figure out what was different, you formed a new assumption and based your thread on that:
"systemd service files don't allow quotes" (title)
"Why is it not possible to use quotes in ExecStart= section of systemd service files"
"because systemd will not run it because of presence of quotes:"
Like frank604 says, quotes were never the issue (in fact, they are one of the few things with special meaning for both the shell and systemd), yet you still seem to think they were:
Lockheed wrote wrote:The actual wrong assumption on my part was that this command would run without quotes as service. It does not.
It is a shame you only quote the first part of my last reply and ignore the questions in the second part. You did almost the same thing with my reply before that and I suspect you also didn't read the man page I mentioned the first time. You basically give me the impression that you think you have it all figured out (even though you come here looking for help) and my follow-up questions aren't worth your time. That usually makes me "move along" pretty quickly, but I'm trying one last time, because even though "The service now works", I'd like to see that you actually understand why it didn't work before.
The only thing you really answered was "Changing paths to absolute made no difference.", but that shouldn't be, so when you mentioned empirical evidence, I basically repeated the question asking for some of this evidence (as in exact error messages for one or more modified ExecStart lines).
When I take your service file and give wget an absolute path, systemd happily executes wget, but then wget complains because it gets "&&" and "cp" and "--save" etc. as arguments. Those errors are what I see in systemctl status/journal, no longer anything about an absolute path. This is because "&&" has no special meaning. You can use semicolons (";") to separate commands instead (explained in the man page section on command lines) or multiple ExecStart lines like frank604 used (which is cleaner IMO). -
[SOLVED] systemd uses cronie.service in /usr/lib instead of /etc
I've been having a little problem getting systemd to use my custom service file for cronie. I've tried doing the same thing with ntpd and a few other services, and they all work fine.
[root@garrett garrett]# cp /{usr/lib,etc}/systemd/system/cronie.service
[root@garrett garrett]# systemctl reenable cronie.service
rm '/etc/systemd/system/multi-user.target.wants/cronie.service'
ln -s '/etc/systemd/system/cronie.service' '/etc/systemd/system/multi-user.target.wants/cronie.service'
[root@garrett garrett]# systemctl status cronie.service
cronie.service - Periodic Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/cronie.service; enabled)
Active: inactive (dead)
CGroup: name=systemd:/system/cronie.service
Sep 13 21:32:52 garrett /usr/sbin/crond[622]: (CRON) INFO (running with inotify support)
It appears to have something to do with the crond.service symlink to cronie.service, since when I remove it, systemd will use the service file in /etc.
[root@garrett garrett]# rm /usr/lib/systemd/system/crond.service
[root@garrett garrett]# cp /{usr/lib,etc}/systemd/system/cronie.service
[root@garrett garrett]# systemctl reenable cronie.service
rm '/etc/systemd/system/multi-user.target.wants/cronie.service'
ln -s '/etc/systemd/system/cronie.service' '/etc/systemd/system/multi-user.target.wants/cronie.service'
[root@garrett garrett]# systemctl status cronie.service
cronie.service - Periodic Command Scheduler
Loaded: loaded (/etc/systemd/system/cronie.service; enabled)
Active: inactive (dead)
CGroup: name=systemd:/system/cronie.service
Sep 13 21:32:52 garrett /usr/sbin/crond[622]: (CRON) INFO (running with inotify support)
However, these symlinks don't cause problems in other packages such as with cups.service, which has a symlink cupsd.service. I also tried the same commands above on another arch computer I have that is running systemd and encountered the same results. This just seems really strange, and I'm not exactly sure where to go from here. Any help would be greatly appreciated.
Last edited by Floft (2012-09-14 06:40:23)I can not replicate on my system.
# find {/usr/lib,/etc}/systemd/system/ -name "*cron*" -ls
803795 4 -rw-r--r-- 1 root root 174 Aug 8 22:24 /usr/lib/systemd/system/cronie.service
803798 0 lrwxrwxrwx 1 root root 14 Aug 8 22:24 /usr/lib/systemd/system/crond.service -> cronie.service
793796 4 -rw-r--r-- 1 root root 174 Sep 14 03:01 /etc/systemd/system/cronie.service
932745 0 lrwxrwxrwx 1 root root 34 Sep 14 03:01 /etc/systemd/system/multi-user.target.wants/cronie.service -> /etc/systemd/system/cronie.service
# systemctl status cronie
cronie.service - Periodic Command Scheduler
Loaded: loaded (/etc/systemd/system/cronie.service; enabled)
Active: active (running) since Fri, 14 Sep 2012 03:06:05 -0300; 1s ago
Main PID: 13956 (crond)
CGroup: name=systemd:/system/cronie.service
└ 13956 /usr/sbin/crond -n
Maybe you are looking for
-
Dear All, Our users need to share the work list for PO Approval workflow with others in the dept. but if the user other than the one who was the initial recipient of the notification approves the PO; the workflow approval history still shows the orig
-
Hi there, I'm trying to use my wife's 8530 as a wireless modem for my laptop. Data plan turned on through Koodo - fine. Run BB desktop, connect the phone, select wireless internet - get a message that "the radio is not turned on"... What?? Help pleas
-
Why does my iPod Touch keep changing the date and year?
Whenever I charge my iPod Touch after it completely dies, Safari never loads whatever site I'm trying to go on and the date always goes to Thursday, January 1st, 1970. I noticed the time always changes as well. i.e. it's 10:47am now and the time on t
-
Chapter markers causing iDVD encoding error
TIP: I discovered that the text used for a chapter marker in FCE can cause the DVD encoding in iDVD to fail. I kept getting encoding errors at the end and tried multiple fixes without success. The solution was to remove the apostrophe that was insert
-
How can I regain control of .bash_profile after making changes to $PATH?
Hi, Today, I installed Android ADB on my MBP (late 2013) and used the following guide to get it started: http://www.droidviews.com/a-comprehensive-guide-to-adb-android-debug-bridge-and- commands/ - that guide said I should make a change to ~/bash_pro