2

I'm creating a non-interactive kiosk in Raspbian. I gutted everything I didn't want - desktop managers, various graphical services etc - the script starts X, an absolutely minimal desktop manager and Chromium, plus a dozen lines that combat all kinds of screen blanking features and another dozen or more that prevent Chromium from spamming various popups.

I created the unit file for systemd as well.

It works fine when started from command line. It works fine from systemctl start chromium.service. But for the life of me I can't get it to launch automatically on startup.

First, the unit file /etc/systemd/system/chromium.service :

[Unit]
Description=Start X and Chromium in kiosk mode
After=getty.target

[Service]
Type=idle
User=pi
ExecStart=/home/pi/start-chromium

[Install]
WantedBy=graphical.target

Graphical target is the default:

 root@raspberrypi:/home/pi# ls -l /etc/systemd/system/default.target
 lrwxrwxrwx 1 root root 36 lut 24 17:00 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target

It's already activated:

  root@raspberrypi:/home/pi# ls -l /etc/systemd/system/graphical.target.wants/
  lrwxrwxrwx 1 root root 36 lut 24 16:28 chromium.service -> /etc/systemd/system/chromium.service

The boot-up messages show the graphical.target was reached; the custom service should fit between getty and graphical.target:

[  OK  ] Started Terminate Plymouth Boot Screen.
         Starting Getty on tty1...
[  OK  ] Started Getty on tty1.
         Starting Serial Getty on ttyAMA0...
[  OK  ] Started Serial Getty on ttyAMA0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started LSB: Start NTP daemon.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.

But the custom service doesn't appear anywhere in logs.

-- The start-up result is done.
lut 24 14:06:03 raspberrypi systemd[1]: Starting Getty on tty1...
-- Subject: Unit autologin@tty1.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit autologin@tty1.service has begun starting up.
lut 24 14:06:03 raspberrypi systemd[1]: Started Getty on tty1.
-- Subject: Unit autologin@tty1.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit autologin@tty1.service has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:03 raspberrypi systemd[1]: Starting Serial Getty on ttyAMA0...
-- Subject: Unit serial-getty@ttyAMA0.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit serial-getty@ttyAMA0.service has begun starting up.
lut 24 14:06:03 raspberrypi systemd[1]: Started Serial Getty on ttyAMA0.
-- Subject: Unit serial-getty@ttyAMA0.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit serial-getty@ttyAMA0.service has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:03 raspberrypi systemd[1]: Starting Login Prompts.
-- Subject: Unit getty.target has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit getty.target has begun starting up.
lut 24 14:06:03 raspberrypi systemd[1]: Reached target Login Prompts.
-- Subject: Unit getty.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit getty.target has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:03 raspberrypi ntpd[492]: ntpd 4.2.6p5@1.2349-o Mon Nov  2 04:29:47 UTC 2015 (1)
lut 24 14:06:03 raspberrypi ntpd[499]: proto: precision = 0.833 usec
lut 24 14:06:03 raspberrypi ntp[464]: Starting NTP server: ntpd.
lut 24 14:06:03 raspberrypi systemd[1]: Started LSB: Start NTP daemon.
-- Subject: Unit ntp.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit ntp.service has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:03 raspberrypi systemd[1]: Starting Multi-User System.
-- Subject: Unit multi-user.target has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit multi-user.target has begun starting up.
lut 24 14:06:03 raspberrypi systemd[1]: Reached target Multi-User System.
-- Subject: Unit multi-user.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit multi-user.target has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:03 raspberrypi systemd[1]: Starting Graphical Interface.
-- Subject: Unit graphical.target has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit graphical.target has begun starting up.
lut 24 14:06:03 raspberrypi systemd[1]: Reached target Graphical Interface.
-- Subject: Unit graphical.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Edit:

root@raspberrypi:/home/pi# journalctl -u chromium
-- Logs begin at śro 2016-02-24 14:05:59 UTC, end at czw 2016-02-25 09:11:23 UTC. --

root@raspberrypi:/home/pi# systemctl status chromium
● chromium.service - Start X and Chromium in kiosk mode
   Loaded: loaded (/etc/systemd/system/chromium.service; enabled)
   Active: inactive (dead)

(this doesn't change, whether I make the script finish sending all its processes to background, or wait at the end (removing the & from the last command which is chromium-browser).

What am I missing?

Edit2: Journal with Loglevel=debug. There are some entries regarding Chromium near 13:32:45 but they don't reveal anything to me.

lut 24 14:06:15 raspberrypi systemd[520]: pam_unix(systemd-user:session): session opened for user pi by (uid=0)
lut 24 14:06:15 raspberrypi systemd[520]: Executing: /lib/systemd/systemd --user
lut 24 14:06:15 raspberrypi systemd[520]: Starting Paths.
-- Subject: Unit UNIT has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has begun starting up.
lut 24 14:06:15 raspberrypi systemd[520]: Reached target Paths.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[520]: Starting Timers.
-- Subject: Unit UNIT has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has begun starting up.
lut 24 14:06:15 raspberrypi systemd[520]: Reached target Timers.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[520]: Starting Sockets.
-- Subject: Unit UNIT has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has begun starting up.
lut 24 14:06:15 raspberrypi systemd[520]: Reached target Sockets.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[520]: Starting Basic System.
-- Subject: Unit UNIT has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has begun starting up.
lut 24 14:06:15 raspberrypi systemd[520]: Reached target Basic System.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[520]: Starting Default.
-- Subject: Unit UNIT has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has begun starting up.
lut 24 14:06:15 raspberrypi systemd[520]: Reached target Default.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit UNIT has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[520]: Startup finished in 66ms.
-- Subject: System start-up is now complete
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- All system services necessary queued for starting at boot have been
-- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
--
-- Kernel start-up required KERNEL_USEC microseconds.
--
-- Initial RAM disk start-up required INITRD_USEC microseconds.
--
-- Userspace start-up required 66978 microseconds.
lut 24 14:06:15 raspberrypi systemd[1]: Got notification message for unit user@1000.service
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service: Got notification message from PID 520 (READY=1...)
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service: got READY=1
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service changed start -> running
lut 24 14:06:15 raspberrypi systemd[1]: Job user@1000.service/start finished, result=done
lut 24 14:06:15 raspberrypi systemd[1]: Started User Manager for UID 1000.
-- Subject: Unit user@1000.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user@1000.service has finished starting up.
--
-- The start-up result is done.
lut 24 14:06:15 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=JobRemoved cookie=109 reply_cookie=0 error=n/a
lut 24 14:06:15 raspberrypi systemd[1]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=110 reply_cookie=0 error=n/a
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service: got STATUS=Startup finished in 66ms.
lut 24 14:06:15 raspberrypi systemd[1]: Got notification message for unit user@1000.service
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service: got STATUS=Startup finished in 66ms.
lut 24 14:06:15 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/user_401000_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=111 reply_cookie=0 error=n/a
lut 24 14:06:15 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/user_401000_2eservice interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=112 reply_cookie=0 error=n/a
lut 24 14:06:15 raspberrypi systemd[1]: user@1000.service: Got notification message from PID 520 (READY=1...)
lut 24 14:06:16 raspberrypi dhcpcd[415]: eth0: carrier acquired
lut 24 14:06:16 raspberrypi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
lut 24 14:06:16 raspberrypi kernel: smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
lut 24 14:06:16 raspberrypi dhcpcd[415]: DUID 00:01:00:01:1e:4c:e0:00:b8:27:eb:8e:4a:e3
lut 24 14:06:16 raspberrypi dhcpcd[415]: eth0: IAID eb:8e:4a:e3
lut 24 14:06:16 raspberrypi ntpd_intres[512]: host name not found: 0.debian.pool.ntp.org
lut 24 14:06:16 raspberrypi ntpd_intres[512]: host name not found: 1.debian.pool.ntp.org
lut 24 14:06:16 raspberrypi ntpd_intres[512]: host name not found: 2.debian.pool.ntp.org
lut 24 14:06:16 raspberrypi ntpd_intres[512]: host name not found: 3.debian.pool.ntp.org
lut 24 14:06:16 raspberrypi dhcpcd[415]: eth0: using static address 192.168.0.79/24
lut 24 14:06:16 raspberrypi dhcpcd[415]: eth0: adding route to 192.168.0.0/24
lut 24 14:06:16 raspberrypi dhcpcd[415]: eth0: adding default route via 192.168.0.222
lut 24 14:06:16 raspberrypi avahi-daemon[400]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.79.
lut 24 14:06:16 raspberrypi avahi-daemon[400]: New relevant interface eth0.IPv4 for mDNS.
lut 24 14:06:16 raspberrypi avahi-daemon[400]: Registering new address record for 192.168.0.79 on eth0.IPv4.
lut 24 14:06:16 raspberrypi systemd[1]: Accepted new private connection.
lut 24 14:06:16 raspberrypi systemd[1]: Got message type=method_call sender=n/a destination=org.freedesktop.systemd1 object=/org/freedesktop/systemd1/unit/nscd_2eservice interface=org.freedesktop.DBus.Properties member=GetAll cookie=1 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Failed to load configuration for nscd.service: No such file or directory
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=method_return sender=n/a destination=n/a object=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Collecting nscd.service
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=2 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=113 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=3 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=114 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Got disconnect on private connection.
lut 24 14:06:16 raspberrypi systemd[1]: Accepted new private connection.
lut 24 14:06:16 raspberrypi systemd[1]: Got message type=method_call sender=n/a destination=org.freedesktop.systemd1 object=/org/freedesktop/systemd1/unit/unbound_2eservice interface=org.freedesktop.DBus.Properties member=GetAll cookie=1 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Failed to load configuration for unbound.service: No such file or directory
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=method_return sender=n/a destination=n/a object=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Collecting unbound.service
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=2 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=115 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=3 reply_cookie=0 error=n/a
lut 24 14:06:16 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=116 reply_cookie=0 error=n/a
lut 24 14:06:17 raspberrypi systemd[1]: Got disconnect on private connection.
lut 24 14:06:17 raspberrypi dhcpcd[415]: eth0: soliciting an IPv6 router
lut 24 14:06:19 raspberrypi ntpd[506]: Listen normally on 4 eth0 192.168.0.79 UDP 123
lut 24 14:06:19 raspberrypi ntpd[506]: Listen normally on 5 eth0 fe80::ba27:ebff:fe8e:4ae3 UDP 123
lut 24 14:06:19 raspberrypi ntpd[506]: peers refreshed
lut 24 14:06:21 raspberrypi ntpd_intres[512]: DNS 0.debian.pool.ntp.org -> 94.154.96.7
lut 24 14:06:21 raspberrypi ntpd_intres[512]: DNS 1.debian.pool.ntp.org -> 195.46.37.22
lut 24 14:06:21 raspberrypi ntpd_intres[512]: DNS 2.debian.pool.ntp.org -> 193.106.216.30
lut 24 14:06:21 raspberrypi ntpd_intres[512]: DNS 3.debian.pool.ntp.org -> 194.177.4.2
lut 25 13:26:13 raspberrypi systemd[1]: Time has been changed
-- Subject: Time change
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The system clock has been changed to REALTIME microseconds after January 1st, 1970.
lut 25 13:26:13 raspberrypi systemd[520]: Time has been changed
-- Subject: Time change
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The system clock has been changed to REALTIME microseconds after January 1st, 1970.
lut 25 13:26:13 raspberrypi systemd[1]: Set up TFD_TIMER_CANCEL_ON_SET timerfd.
lut 25 13:26:13 raspberrypi systemd[1]: systemd-tmpfiles-clean.timer: time change, recalculating next elapse.
lut 25 13:26:13 raspberrypi systemd[1]: systemd-tmpfiles-clean.timer: Monotonic timer elapses in 14min 26.563229s.
lut 25 13:26:13 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/systemd_2dtmpfiles_2dclean_2etimer interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=117 reply_cookie=0 error=n/a
lut 25 13:26:13 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/systemd_2dtmpfiles_2dclean_2etimer interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=118 reply_cookie=0 error=n/a
lut 25 13:26:13 raspberrypi systemd[1]: Got notification message for unit systemd-journald.service
lut 25 13:26:13 raspberrypi systemd[1]: systemd-journald.service: Got notification message from PID 105 (WATCHDOG=1...)
lut 25 13:26:13 raspberrypi systemd[1]: systemd-journald.service: got WATCHDOG=1
lut 25 13:26:13 raspberrypi systemd[1]: Got notification message for unit systemd-journald.service
lut 25 13:26:13 raspberrypi systemd[1]: systemd-journald.service: Got notification message from PID 105 (WATCHDOG=1...)
lut 25 13:26:13 raspberrypi systemd-journal[105]: Forwarding to syslog missed 159 messages.
-- Subject: One or more messages could not be forwarded to syslog
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- One or more messages could not be forwarded to the syslog service
-- running side-by-side with journald. This usually indicates that the
-- syslog implementation has not been able to keep up with the speed of
-- messages queued.
lut 25 13:26:13 raspberrypi systemd[1]: systemd-journald.service: got WATCHDOG=1
lut 25 13:26:14 raspberrypi dhcpcd[415]: eth0: no IPv6 Routers available
lut 25 13:26:33 raspberrypi systemd[1]: Got notification message for unit systemd-logind.service
lut 25 13:26:33 raspberrypi systemd[1]: systemd-logind.service: Got notification message from PID 396 (WATCHDOG=1...)
lut 25 13:26:33 raspberrypi systemd[1]: systemd-logind.service: got WATCHDOG=1
lut 25 13:26:33 raspberrypi systemd[1]: Got notification message for unit systemd-logind.service
lut 25 13:26:33 raspberrypi systemd[1]: systemd-logind.service: Got notification message from PID 396 (WATCHDOG=1...)

 [...lots of these...]

lut 25 13:32:30 raspberrypi systemd[1]: systemd-logind.service: Got notification message from PID 396 (WATCHDOG=1...)
lut 25 13:32:30 raspberrypi systemd[1]: systemd-logind.service: got WATCHDOG=1
lut 25 13:32:30 raspberrypi systemd[1]: Got message type=method_call sender=:1.1 destination=org.freedesktop.systemd1 object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=StartTransientUnit cookie=27 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetConnectionUnixUser cookie=119 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Failed to load configuration for session-c2.scope: No such file or directory
lut 25 13:32:30 raspberrypi systemd[1]: Trying to enqueue job session-c2.scope/start/fail
lut 25 13:32:30 raspberrypi systemd[1]: Installed new job session-c2.scope/start as 194
lut 25 13:32:30 raspberrypi systemd[1]: Enqueued job session-c2.scope/start as 194
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=120 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=method_return sender=n/a destination=:1.1 object=n/a interface=n/a member=n/a cookie=122 reply_cookie=27 error=n/a
lut 25 13:32:30 raspberrypi systemd-logind[396]: New session c2 of user pi.
-- Subject: A new session c2 has been created for user pi
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID c2 has been created for the user pi.
--
-- The leading process of the session is 632.
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=123 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=JobNew cookie=124 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Starting Session c2 of user pi.
-- Subject: Unit session-c2.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c2.scope has begun starting up.
lut 25 13:32:30 raspberrypi systemd[1]: session-c2.scope changed dead -> running
lut 25 13:32:30 raspberrypi systemd[1]: Job session-c2.scope/start finished, result=done
lut 25 13:32:30 raspberrypi systemd[1]: Started Session c2 of user pi.
-- Subject: Unit session-c2.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c2.scope has finished starting up.
--
-- The start-up result is done.
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=126 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/session_2dc2_2escope interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=127 reply_cookie=0 error=n/a
lut 25 13:32:30 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1/unit/session_2dc2_2escope interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=128 reply_cookie=0 error=n/a
lut 25 13:32:31 raspberrypi systemd[1]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=121 reply_cookie=0 error=n/a
lut 25 13:32:31 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=JobRemoved cookie=125 reply_cookie=0 error=n/a
lut 25 13:32:33 raspberrypi sudo[657]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/su
lut 25 13:32:33 raspberrypi sudo[657]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
lut 25 13:32:33 raspberrypi su[664]: Successful su for root by root
lut 25 13:32:33 raspberrypi su[664]: + /dev/pts/0 root:root
lut 25 13:32:33 raspberrypi su[664]: pam_unix(su:session): session opened for user root by pi(uid=0)
lut 25 13:32:33 raspberrypi systemd[1]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=31 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Accepted new private connection.
lut 25 13:32:45 raspberrypi systemd[1]: Got message type=method_call sender=n/a destination=org.freedesktop.systemd1 object=/org/freedesktop/systemd1/unit/chromium_2eservice interface=org.freedesktop.DBus.Properties member=GetAll cookie=1 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Looking for unit files in (higher priority first):
lut 25 13:32:45 raspberrypi systemd[1]:         /etc/systemd/system
lut 25 13:32:45 raspberrypi systemd[1]:         /run/systemd/system
lut 25 13:32:45 raspberrypi systemd[1]:         /usr/local/lib/systemd/system
lut 25 13:32:45 raspberrypi systemd[1]:         /lib/systemd/system
lut 25 13:32:45 raspberrypi systemd[1]:         /usr/lib/systemd/system
lut 25 13:32:45 raspberrypi systemd[1]: Looking for SysV init scripts in:
lut 25 13:32:45 raspberrypi systemd[1]:         /etc/init.d
lut 25 13:32:45 raspberrypi systemd[1]: Looking for SysV rcN.d links in:
lut 25 13:32:45 raspberrypi systemd[1]:         /etc
lut 25 13:32:45 raspberrypi systemd[1]: Sent message type=method_return sender=n/a destination=n/a object=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Collecting chromium.service
lut 25 13:32:45 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=2 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitNew cookie=129 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=3 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Sent message type=signal sender=n/a destination=n/a object=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.Manager member=UnitRemoved cookie=130 reply_cookie=0 error=n/a
lut 25 13:32:45 raspberrypi systemd[1]: Got disconnect on private connection.
lut 25 13:33:13 raspberrypi systemd[1]: Got notification message for unit systemd-journald.service
lut 25 13:33:13 raspberrypi systemd[1]: systemd-journald.service: Got notification message from PID 105 (WATCHDOG=1...)
lut 25 13:33:13 raspberrypi systemd[1]: systemd-journald.service: got WATCHDOG=1
lut 25 13:33:13 raspberrypi systemd[1]: Got notification message for unit systemd-journald.service
lut 25 13:33:13 raspberrypi systemd[1]: systemd-journald.service: Got notification message from PID 105 (WATCHDOG=1...)
lut 25 13:33:13 raspberrypi systemd[1]: systemd-journald.service: got WATCHDOG=1
  • Any output for journalctl -u chromium or systemctl status chromium? – muru Feb 24 '16 at 18:23
  • @muru: see edit. – SF. Feb 25 '16 at 9:14
1

I would increase the logging verbosity to get more information. Then grep for chromium in the log file and show us the appropriate snippets.

To increase verbosity, in /etc/systemd/system.conf

LogLevel=debug           <--- Uncomment this line and use "debug" (default: commented and "info")

I suspect your After= line is incorrect ? Your current configurations reads that chromium is started after getty , but is first enabled (read Installs) with the graphical system.

You want chromium to start after the graphical system has started (in fact chromium would Require a graphical system, so I would suggest adding a Requires= after the After= line) and the target should not be getty.target but the graphical.target for both the After= and Requires= lines.

Hopefully, increasing log verbosity will reveal this. I have not tried what you are attempting so this is purely a theoretical suggestion based upon my interpretation of the manual.

epilogue, The Install= appears to work, since when you start manually (after the graphical system is started) you say it works fine.

  • The Chromium script replaces the graphical system. X-windows is started from that script. The whole mechanics of xinit, .xinitrc, and so on is bypassed - normally there's a bunch of things loaded there that I have no control over, and no need of, as all they can do for me is intruding into the kiosk screen. Currently, besides chromium, the only thing in graphical.target.wants (both /etc and /lib) is systemd-update-utmp-runlevel.service. – SF. Feb 25 '16 at 13:22
  • I did as you asked with systemctl.conf, attached a piece of the new log. It mentions chromium.service so it isn't entirely ignored... – SF. Feb 25 '16 at 14:02
  • Hmmn I see, so it is reached but doesn't start any jobs. Your Type=idle check out the doc paragraph re idle systemctl list-jobs will show waiting jobs – X Tian Feb 25 '16 at 16:23
  • 1
    I choose Idle because I wanted it to start last, when normally X starts. It can be simple or forking just fine (need to add one & in the script for forking). I'll check the jobs soon (currently the disk image is being backed up). – SF. Feb 25 '16 at 16:34
  • 1
    systemctl list-jobs: no jobs running. I tried with forking, nothing. Finally, lost my patience and added it to bashrc (in a singletonish way so new shells won't try to spawn it again), and works like charm. I hate systemd. – SF. Feb 25 '16 at 16:58
-3
  1. Create the custom service as a script
  2. open the file /etc/rc.d/rc.local
  3. At the end of the file line point the script file location like sh /{path to file}/{filename}.sh
  4. remember both /etc/rc.d/rc.local and /{path to file}/{filename}.sh should have executable permission

    Note: /etc/rc.d/rc.local used by linux system to run last minute custom script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.