I searching now already for more then 2 hours..
A time ago i made an systemd service for an PHP app. This worked great untill yesterday morning. The service stopped working on boot and the command 'sudo systemctl start TcpSocket' doesn't work either, it shows the blinking cursor and i have to exit it with ctrl+c.
Running the app with the command 'php /home/ttn-admin/Scripts/TcpSocket.php' works without problems.
Content of the service file:
[Unit]
Description=TcpSocket Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/bin/php /home/ttn-admin/Scripts/TcpSocket.php
[Install]
WantedBy=multi-user.target
the command 'journalctl -u TcpSocket.service -f -n100' shows only untill yesterday morning.
I don't know where to look anymore and why it stopped working after some years...
Thanks.
Edit 1:
Output of 'systemctl status TcpSocket':
TcpSocket.service - TcpSocket Service Loaded: loaded (/usr/lib/systemd/system/TcpSocket.service; disabled; vendor preset: disabled) Active: inactive (dead)
Output of 'systemctl status':
ttn-server
State: starting
Jobs: 16 queued
Failed: 0 units
Since: Tue 2023-01-10 13:07:37 UTC; 51s ago
CGroup: /
├─user.slice
│ └─user-0.slice
│ ├─session-1.scope
│ │ ├─ 1317 /usr/libexec/cockpit-session localhost
│ │ ├─ 1331 cockpit-bridge
│ │ ├─ 1352 /usr/libexec/cockpit-pcp
│ │ ├─ 1374 /bin/bash
│ │ ├─ 1402 systemctl status
│ │ └─ 1403 less
│ └─[email protected] …
│ ├─session.slice
│ │ └─dbus-broker.service
│ │ ├─ 1366 /usr/bin/dbus-broker-launch --scope user
│ │ └─ 1370 dbus-broker --log 4 --controller 9 --machine-id b5d31d5285d04f3abc6786e2fd9dd45e --max-bytes 100000000000000 --max>
│ └─init.scope
│ ├─ 1322 /usr/lib/systemd/systemd --user
│ └─ 1323 (sd-pam)
├─init.scope
│ └─ 1 /usr/lib/systemd/systemd rhgb --switched-root --system --deserialize 31
└─system.slice
├─irqbalance.service
│ └─ 766 /usr/sbin/irqbalance --foreground
├─abrt-journal-core.service
│ └─ 791 /usr/bin/abrt-dump-journal-core -D -T -f -e
├─packagekit.service
│ └─ 1369 /usr/libexec/packagekitd
├─systemd-udevd.service
│ └─ 623 /usr/lib/systemd/systemd-udevd
├─dbus-broker.service
│ ├─ 760 /usr/bin/dbus-broker-launch --scope system --audit
│ └─ 762 dbus-broker --log 4 --controller 9 --machine-id b5d31d5285d04f3abc6786e2fd9dd45e --max-bytes 536870912 --max-fds 4096 --m>
├─systemd-homed.service
│ └─ 771 /usr/lib/systemd/systemd-homed
├─mariadb.service
│ └─ 901 /usr/libexec/mariadbd --basedir=/usr
├─polkit.service
│ └─ 768 /usr/lib/polkit-1/polkitd --no-debug
├─realmd.service
│ └─ 1357 /usr/libexec/realmd
├─systemd-timedated.service
│ └─ 1358 /usr/lib/systemd/systemd-timedated
├─chronyd.service
│ └─ 776 /usr/sbin/chronyd -F 2
├─auditd.service
│ ├─ 727 /sbin/auditd
│ └─ 729 /usr/sbin/sedispatch
├─php-fpm.service
│ ├─ 813 php-fpm: master process (/etc/php-fpm.conf)
│ ├─ 831 php-fpm: pool www
│ ├─ 832 php-fpm: pool www
│ ├─ 833 php-fpm: pool www
│ ├─ 834 php-fpm: pool www
│ └─ 835 php-fpm: pool www
├─abrt-xorg.service
│ └─ 793 /usr/bin/abrt-dump-journal-xorg -fxtD
├─ModemManager.service
│ └─ 796 /usr/sbin/ModemManager
├─systemd-journald.service
│ └─ 611 /usr/lib/systemd/systemd-journald
├─atd.service
│ └─ 1020 /usr/sbin/atd -f
├─sshd.service
│ └─ 819 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
├─crond.service
│ └─ 1031 /usr/sbin/crond -n
├─NetworkManager.service
│ └─ 804 /usr/sbin/NetworkManager --no-daemon
├─cockpit.service
│ └─ 1303 /usr/libexec/cockpit-tls
├─systemd-hostnamed.service
│ └─ 1342 /usr/lib/systemd/systemd-hostnamed
├─gssproxy.service
│ └─ 821 /usr/sbin/gssproxy -D
├─rsyslog.service
│ └─ 769 /usr/sbin/rsyslogd -n
├─abrtd.service
│ └─ 773 /usr/sbin/abrtd -d -s
├─firewalld.service
│ └─ 797 /usr/bin/python3 -s /usr/sbin/firewalld --nofork --nopid
├─systemd-userdbd.service
│ ├─ 726 /usr/lib/systemd/systemd-userdbd
│ ├─ 733 systemd-userwork
│ ├─ 734 systemd-userwork
│ └─ 735 systemd-userwork
├─system-cockpithttps.slice
│ └─cockpit-wsinstance-https@e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.service
│ ├─ 1309 /usr/libexec/cockpit-ws --for-tls-proxy --port=0
│ └─ 1319 /usr/bin/ssh-agent
├─httpd.service
│ ├─ 1000 /usr/sbin/httpd -DFOREGROUND
│ ├─ 1089 /usr/sbin/httpd -DFOREGROUND
│ ├─ 1090 /usr/sbin/httpd -DFOREGROUND
│ ├─ 1091 /usr/sbin/httpd -DFOREGROUND
│ └─ 1094 /usr/sbin/httpd -DFOREGROUND
├─systemd-oomd.service
│ └─ 724 /usr/lib/systemd/systemd-oomd
├─mcelog.service
│ └─ 767 /usr/sbin/mcelog --daemon --foreground
├─systemd-resolved.service
│ └─ 725 /usr/lib/systemd/systemd-resolved
├─pmcd.service
│ ├─ 1004 /usr/bin/sh /usr/libexec/pcp/lib/pmcd start-systemd
│ └─ 1297 /usr/libexec/pcp/bin/pmcd_wait
├─system-getty.slice
│ └─[email protected]
│ └─ 1059 /sbin/agetty -o -p -- \u --noclear tty1 linux
├─smartd.service
│ └─ 770 /usr/sbin/smartd -n -q never --capabilities=mail
├─systemd-logind.service
│ └─ 772 /usr/lib/systemd/systemd-logind
└─abrt-oops.service
└─ 792 /usr/bin/abrt-dump-journal-oops -fxtD
systemctl status
to get the overall status of the system, does the second line sayState: running
or something different? If it saysState: degraded
, it means one or more services have failed (runsystemctl
without any parameters to see which one(s)). Since your service type isidle
, your service may start only after every other service has successfully started... and if there is a problem with another service, might not start at all. It sort of seems like the system is waiting for something to complete, but it doesn't.running
ordegraded
, and ifdegraded
, which services have failed?