Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
-1
votes
2
answers
1021
views
What's the difference between `active` and `running` states of `systemctl list-units`?
I see from manual of `systemctl` that's the difference is `high-` and `low-` levels. What does that mean? I suppose that `active` means "started automatically while OS starts" and `running` means "is active right now".
I see from manual of
systemctl
that's the difference is high-
and low-
levels.
What does that mean?
I suppose that active
means "started automatically while OS starts" and running
means "is active right now".
palmasd1
(127 rep)
Apr 26, 2024, 06:42 AM
• Last activity: Aug 4, 2025, 01:07 PM
0
votes
1
answers
2957
views
On systemctl start, "Failed to start gitlab-runner.service: Unit is not loaded properly: Bad message."
Whenever I run `systemctl start gitlab-runner.service` I get, systemctl start gitlab-runner.service Failed to start gitlab-runner.service: Unit is not loaded properly: Bad message. See system logs and 'systemctl status gitlab-runner.service' for details. How can I find more information about this er...
Whenever I run
systemctl start gitlab-runner.service
I get,
systemctl start gitlab-runner.service
Failed to start gitlab-runner.service: Unit is not loaded properly: Bad message.
See system logs and 'systemctl status gitlab-runner.service' for details.
How can I find more information about this error, what does this mean?
Evan Carroll
(34663 rep)
Mar 22, 2020, 04:35 PM
• Last activity: Jul 26, 2025, 03:09 AM
0
votes
1
answers
2110
views
Systemd does not seem to be generating the Main PID properly
I modified the /lib/systemd/system/snmpd.service file as needed. Below is the contents of the snmpd.service file that I modified. ``` [Unit] Description=Simple Network Management Protocol (SNMP) Daemon. After=network.target ConditionPathExists=/etc/snmp/snmpd.conf [Service] Type=notify RuntimeDirect...
I modified the /lib/systemd/system/snmpd.service file as needed.
Below is the contents of the snmpd.service file that I modified.
[Unit]
Description=Simple Network Management Protocol (SNMP) Daemon.
After=network.target
ConditionPathExists=/etc/snmp/snmpd.conf
[Service]
Type=notify
RuntimeDirectory=agentx
ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
After daemon-reload, I entered the command "systemctl start snmpd".
And I got the error below.
× snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
Loaded: loaded (/lib/systemd/system/snmpd.service; enabled; vendor preset: enabled)
Active: failed (Result: protocol) since Thu 2023-03-16 11:39:21 KST; 12min ago
Process: 3046725 ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid (code=exited, status=0/SUCCESS)
Main PID: 3046725 (code=exited, status=0/SUCCESS)
CPU: 48ms
Mar 16 11:39:21 esm-dev systemd: Starting Simple Network Management Protocol (SNMP) Daemon....
Mar 16 11:39:21 esm-dev snmpd: Turning on AgentX master support.
Mar 16 11:39:21 esm-dev snmpd: NET-SNMP version 5.9.1
Mar 16 11:39:21 esm-dev systemd: snmpd.service: Got notification message from PID 3046727, but reception only permitted for main PID which is currently not known
Mar 16 11:39:21 esm-dev snmpd: Received TERM or STOP signal... shutting down...
Mar 16 11:39:21 esm-dev systemd: snmpd.service: Failed with result 'protocol'.
Mar 16 11:39:21 esm-dev systemd: Failed to start Simple Network Management Protocol (SNMP) Daemon..
According to the error, it seems that the main PID and the PID that delivered the notification message are different.
Main PID: 3046725
Got notification message from PID 3046727
...
and
The /run/snmpd.pid file contained 3046727
One interesting thing is that the difference between the MainPID and the PID that delivered the notification message is always 2.
When I entered systemctl start snmpd again,
× snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
Loaded: loaded (/lib/systemd/system/snmpd.service; enabled; vendor preset: enabled)
Active: failed (Result: protocol) since Thu 2023-03-16 11:58:30 KST; 2s ago
Process: 3047690 ExecStart=/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid (code=exited, status=0/SUCCESS)
Main PID: 3047690 (code=exited, status=0/SUCCESS)
CPU: 41ms
Mar 16 11:58:30 esm-dev systemd: Starting Simple Network Management Protocol (SNMP) Daemon....
Mar 16 11:58:30 esm-dev snmpd: Turning on AgentX master support.
Mar 16 11:58:30 esm-dev snmpd: NET-SNMP version 5.9.1
Mar 16 11:58:30 esm-dev snmpd: Received TERM or STOP signal... shutting down...
Mar 16 11:58:30 esm-dev systemd: snmpd.service: Got notification message from PID 3047692, but reception only permitted for main PID which is currently not known
Mar 16 11:58:30 esm-dev systemd: snmpd.service: Failed with result 'protocol'.
Mar 16 11:58:30 esm-dev systemd: Failed to start Simple Network Management Protocol (SNMP) Daemon..
MainPID: 3047690
Got notification message from PID 3047692
I wonder why MainPID and notification message from PID are different. And I wonder how to run snmpd normally with systemctl.
anyone help me?
monster-dev
(19 rep)
Mar 16, 2023, 03:58 AM
• Last activity: Jul 18, 2025, 03:03 AM
2
votes
1
answers
2394
views
how to verify current open files on specific service
on our rhel server 7.6 version we have the following systemctl service /etc/systemd/system/test-infra.service and the value of LimitNOFILE is systemctl show test-infra.service | grep LimitNOFILE LimitNOFILE=65535 so I assume the number of open files is max 65535 per this service is it possible to pr...
on our rhel server 7.6 version we have the following systemctl service
/etc/systemd/system/test-infra.service
and the value of LimitNOFILE is
systemctl show test-infra.service | grep LimitNOFILE
LimitNOFILE=65535
so I assume the number of open files is max 65535 per this service
is it possible to print the current of open files that are used by this service?
or how to show how many files this service is using?
yael
(13936 rep)
Jan 5, 2021, 11:58 AM
• Last activity: Jul 6, 2025, 04:06 AM
2
votes
1
answers
5447
views
systemd: my service stopped working with code=killed
My service has suddenly stopped working, `systemctl status` reports: Main PID: 5459 (code=killed, signal=TERM) Also, I checked through `journald` for my service (`journalctl -u myservice.service`) and the last entry is: systemd[1]: Stopped MyService Service. Does this mean it was manually stopped wi...
My service has suddenly stopped working,
systemctl status
reports:
Main PID: 5459 (code=killed, signal=TERM)
Also, I checked through journald
for my service (journalctl -u myservice.service
) and the last entry is:
systemd: Stopped MyService Service.
Does this mean it was manually stopped with systemctl stop
or it might as well mean it has crashed? Is there a way to tell?
Mark
(1943 rep)
Jun 7, 2022, 09:23 PM
• Last activity: Jul 2, 2025, 07:08 PM
3
votes
2
answers
1092
views
allow $HOME env var in execstart in systemctl.service file
I want to do something like this: [Unit] Description=ROT13 demo service After=network.target StartLimitIntervalSec=1 [Service] Type=simple User=oleg ExecStart=$HOME/.local/bin/cprev-agent # user the home env var [Install] WantedBy=multi-user.target is there a way to use a $HOME env var like I did th...
I want to do something like this:
[Unit]
Description=ROT13 demo service
After=network.target
StartLimitIntervalSec=1
[Service]
Type=simple
User=oleg
ExecStart=$HOME/.local/bin/cprev-agent # user the home env var
[Install]
WantedBy=multi-user.target
is there a way to use a $HOME env var like I did there or does it need to be hardcoded?
Alexander Mills
(10734 rep)
Mar 22, 2020, 03:09 AM
• Last activity: Jun 30, 2025, 12:31 AM
0
votes
1
answers
1971
views
Not launched uwsgi by systemctl
I can not start uwsgi by systemctl. my error log is here below. $sudo systemctl status uwsgi.service ● uwsgi.service - uWSGI Loaded: loaded (/etc/systemd/system/uwsgi.service; enabled; vendor preset: enabled) Active: failed (Result: protocol) since Thu 2020-04-23 03:13:02 JST; 6s ago Main PID: 24676...
I can not start uwsgi by systemctl.
my error log is here below.
$sudo systemctl status uwsgi.service
● uwsgi.service - uWSGI
Loaded: loaded (/etc/systemd/system/uwsgi.service; enabled; vendor preset: enabled)
Active: failed (Result: protocol) since Thu 2020-04-23 03:13:02 JST; 6s ago
Main PID: 24676 (code=exited, status=0/SUCCESS)
Status: "initializing uWSGI"
Apr 23 03:13:02 ip-172-17-1-78 systemd: uwsgi.service: Service hold-off time over, scheduling restart.
Apr 23 03:13:02 ip-172-17-1-78 systemd: uwsgi.service: Scheduled restart job, restart counter is at 5.
Apr 23 03:13:02 ip-172-17-1-78 systemd: Stopped uWSGI.
Apr 23 03:13:02 ip-172-17-1-78 systemd: uwsgi.service: Start request repeated too quickly.
Apr 23 03:13:02 ip-172-17-1-78 systemd: uwsgi.service: Failed with result 'protocol'.
Apr 23 03:13:02 ip-172-17-1-78 systemd: Failed to start uWSGI.
I googled around and found this error might be related with anaconda.
I use
uwsgi
under conda environment.
/home/ubuntu/anaconda3/envs/py37/bin/uwsgi
uwsgi.service
[Unit]
Description = uWSGI
After = syslog.target
[Service]
ExecStart = /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini /var/www/html/myapp/uwsgi.ini
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target
I use command line /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini /var/www/html/myapp/uwsgi.ini
.
It works.
However how can I fix this??
my uwsgi.ini
is here below
[uwsgi]
chdir=/var/www/html/myapp/current
module=myapp.wsgi
env DJANGO_SETTINGS_MODULE=myapp.settings
http = 0.0.0.0:8008
processes = 4
threads = 1
master = 1
max-requests = 100
max-requests-delta = 5
pythonpath = /home/ubuntu/anaconda3/envs/py37/lib/python3.7/site-packages
pythonhome = /home/ubuntu/anaconda3/envs/py37/bin
harakiri = 280
daemonize = /var/log/uwsgi.log
log-reopen = true
log-maxsize = 8000000
logfile-chown = on
logfile-chmod = 644
pidfile = /var/run/uwsgi/uwsgi.pid
stats = /var/run/uWSGI/projectname.stats.sock
memory-report = true
whitebear
(245 rep)
Apr 22, 2020, 06:16 PM
• Last activity: Jun 28, 2025, 06:01 PM
0
votes
1
answers
202
views
How to run a systemd-enabled container with Podman?
I am trying to run a systemd-enabled container using Podman, specifically with a Rocky Linux base image. While I have seen multiple references to Podman supporting systemd, I haven't been able to set it up successfully. Here are the steps I've tried so far: 1. Pulled the rockylinux:latest image. 2....
I am trying to run a systemd-enabled container using Podman, specifically with a Rocky Linux base image. While I have seen multiple references to Podman supporting systemd, I haven't been able to set it up successfully.
Here are the steps I've tried so far:
1. Pulled the rockylinux:latest image.
2. Installed systemd inside the container
yum install -y systemd systemd-libs
mkdir -p /var/log/journal
exit
3. Committed the container to a new image using:
podman commit rocky-systemd rocky-systemd:latest
4. Started the container and systemctl prints 'degraded' status!
Moha
(1 rep)
Jan 20, 2025, 10:18 PM
• Last activity: Jun 25, 2025, 08:04 PM
1
votes
1
answers
3777
views
systemctl authenticating as other user
I have made this script that allows non-root access for a directory so a program can make changes to files in said directories. This .service has worked on a few machines and even on the same machine in the past however after a fresh reinstall of arch linux `systemd`/`systemctl` is "Authenticating a...
I have made this script that allows non-root access for a directory so a program can make changes to files in said directories. This .service has worked on a few machines and even on the same machine in the past however after a fresh reinstall of arch linux
systemd
/systemctl
is "Authenticating as: mpd".
The weird thing is when i use sudo
to start it. It will work but using enable doesn't persist on reboot.
I'm don't really know what I'm doing so i apologize I'm gonna read up on systemd after the semester.
[oddstap@Arch2019 ~]$ systemctl enable brightlight.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ====
Authentication is required to manage system service or unit files.
Authenticating as: mpd
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ====
Failed to enable unit: Access denied
[oddstap@Arch2019 ~]$
I'm not really sure why this is I've tried a few things like using the --user
flag and then giving the exact directory. It has mixed results/ Ive also tried putting the service file in /etc/systemd/system
that just does the same thing.
[oddstap@Arch2019 /usr/lib/systemd/system]$ systemctl --user enable /usr/lib/systemd/system/brightlight.service
Removed /home/oddstap/.config/systemd/user/multi-user.target.wants/brightlight.service.
Created symlink /home/oddstap/.config/systemd/user/multi-user.target.wants/brightlight.service → /usr/lib/systemd/system/brightlight.service.
[oddstap@Arch2019 /usr/lib/systemd/system]$
I've seen a similar issue I think [on Server Fault](https://serverfault.com/questions/841306/authentication-is-required-to-manage-system-services-or-units) .
Here is the .service file I posted it here I'm pretty sure this is not the cause but I could be wrong. I'm gonna try to fix this but if anyone got any ideas let me know. Not having systemd enabling scripts is making my life hard.
[Unit]
Description Hopefully will be a solution for you reading.
Before nodered.service
[Service]
Type oneshot
User root
ExecStart=/bin/bash -c "/bin/chmod a+w /sys/class/backlight/intel_backlight/*"
[Install]
WantedBy=multi-user.target
mr Stap
(61 rep)
Dec 2, 2019, 06:34 AM
• Last activity: Jun 15, 2025, 07:06 PM
1
votes
0
answers
55
views
Should systemctl restart be equivalent to stop + start?
Today, while trying to debug some rsyslog issues, I changed the rsyslog configuration files and then ran systemctl restart rsyslog A `sytemctl status` showed that rsyslog was running, but its log files were not being written. I then invoked systemctl stop rsyslog systemctl start rsyslog At this poin...
Today, while trying to debug some rsyslog issues, I changed the rsyslog configuration files and then ran
systemctl restart rsyslog
A
sytemctl status
showed that rsyslog was running, but its log files were not being written.
I then invoked
systemctl stop rsyslog
systemctl start rsyslog
At this point rsyslog's log files began growing.
I thought this might have been a fluke, but I repeated the process with the same results.
I assume that restart
should have been the same as stop
+ start
. Does this sound like a bug in systemd, or in the rsyslog service?
Steve Summit
(918 rep)
May 30, 2025, 04:06 PM
1
votes
2
answers
110
views
How to extract specific fields from systemctl output for a custom report
I would like to build a report coming from the output of certain commands. For instance, I have the output of such command: systemctl --type=service --state=running | grep -e cron -e apache2 -e mariadb -e memcached -e php8.4-fpm -e redis > servizi.txt && systemctl --state=mounted | grep -e /mnt/ncda...
I would like to build a report coming from the output of certain commands.
For instance, I have the output of such command:
systemctl --type=service --state=running |
grep -e cron -e apache2 -e mariadb -e memcached -e php8.4-fpm -e redis > servizi.txt &&
systemctl --state=mounted |
grep -e /mnt/ncdata -e /mnt/share >> servizi.txt.
Now in the file
servizi.txt
I have the following:
apache2.service loaded active running The Apache HTTP Server
cron.service loaded active running Regular background program processing daemon
mariadb.service loaded active running MariaDB 10.11.11 database server
memcached.service loaded active running memcached daemon
php8.4-fpm.service loaded active running The PHP 8.4 FastCGI Process Manager
redis-server.service loaded active running Advanced key-value store
mnt-ncdata.mount loaded active mounted /mnt/ncdata
mnt-share.mount loaded active mounted /mnt/share
I'm looking to extract only the name of the service and the 2nd, 3rd and 4th value in order to have something like this:
apache2.service loaded active running
Can someone of you give me a hint? I really appreciate.
Nick
(19 rep)
May 3, 2025, 04:12 PM
• Last activity: May 3, 2025, 09:06 PM
2
votes
1
answers
203
views
How to automatically start a GUI application when plugging in a USB device?
I want to automatically start a GUI application, whenever I plug in a certain USB device. When started, the application runs in the foreground and should not run as root. How can I do that? In my specific case, I want to run [Yubico Authenticator](https://www.yubico.com/products/yubico-authenticator...
I want to automatically start a GUI application, whenever I plug in a certain USB device.
When started, the application runs in the foreground and should not run as root.
How can I do that?
In my specific case, I want to run [Yubico Authenticator](https://www.yubico.com/products/yubico-authenticator/) whenever I plug in my Yubikey USB FIDO2/TOTP hardware token.
luziferius
(87 rep)
Feb 11, 2025, 02:39 PM
• Last activity: May 2, 2025, 08:09 AM
0
votes
1
answers
87
views
systemctl daemon-reload needed after reboot
I have an issue that after each reboot my service will be gone until I do a `systemctl daemon-reload`. The service: [Unit] Description=MyService Requires=local-fs.target remote-fs.target After=network.target local-fs.target remote-fs.target [Service] ExecStart=/repo/foo/start.sh WorkingDirectory=/re...
I have an issue that after each reboot my service will be gone until I do a
systemctl daemon-reload
.
The service:
[Unit]
Description=MyService
Requires=local-fs.target remote-fs.target
After=network.target local-fs.target remote-fs.target
[Service]
ExecStart=/repo/foo/start.sh
WorkingDirectory=/repo/foo
Environment=PYTHONUNBUFFERED=1
Restart=always
RestartSec=5
User=myuser
[Install]
WantedBy=multi-user.target
How I 'added' the service:
sudo ln -s /mnt/foo/myservice.service /etc/systemd/system/myservice.service
sudo systemctl daemon-reload
sudo systemctl enable myservice.service
sudo start enable myservice.service
So basically the service is stored on a mount point that I guess does not exists on boot. Is there anyway to avoid this issue and still user the /mnt/foo/myservice.service
-path?
I have tried looking at logs with sudo journalctl -xe
and such but without success. I do not find anything about the myservice.service is not found or anything?
Jesper.Lindberg
(357 rep)
Apr 29, 2025, 08:31 AM
• Last activity: Apr 29, 2025, 07:56 PM
0
votes
2
answers
120
views
Can't get a systemd service to start in Fedora
I'm writing a `systemd` service that will literally do something "stupid," such as display an on-screen message at shutdown time, saying something such as "Thank you for using this computer. It was our pleasure to have been able to assist you today. Have a good day." Were my shutdown script to actua...
I'm writing a
systemd
service that will literally do something "stupid," such as display an on-screen message at shutdown time, saying something such as "Thank you for using this computer. It was our pleasure to have been able to assist you today. Have a good day."
Were my shutdown script to actually execute (run), it should place the above message into a plain-text file, into /root/MyScripts/Shutdown/test.txt
but it just will not work despite having tried many variations over the last six weeks of nearly constantly wracking my brains.
This is my test message script which is supposed to be invoked by systemd
immediately before shutdown, but fails to do so.
#ShutdownMesg.sh
#!/bin/bash
echo -e 'Hello, World! \nHave a good day!' >> test.txt
z=0
for i in {1..3}; do
sleep 1m
((z++))
echo ""
done
chmod u+x ShutdownMesg.sh
Note that I have included a simple loop so that the system will insert a 3 minutes pause to ensure that my test file has time to be written-to before actual shutdown occurs.
Code for my systemd
service:
[Unit]
Description=Create a simple test message at shutdown but will add more useful shutdown commands later
DefaultDependencies=no
Before=poweroff.target
[Service]
Type=forking
RemainAfterExit=yes
ExecStart=/root/MyScripts/Shutdown/ShutdownMesg.sh
[Install]
WantedBy=poweroff.target
After creating the above service, I then did the following:
Placed it in a plain text file in /usr/lib/systemd/system/myshutdownmesg.service
and enabled it with systemctl enable myshutdownmesg.service
and then did a systemctl daemon-reload
, followed by a systemctl list-unit-files
.
When this last command runs, I get a long list of services. My particular service, along with others, is listed in a column to the far left-hand side of the screen; the second column shows that my service is enabled, but the third column shows that it's disabled.
When executing systemctl start myshutdownmesg.service
, I received the following error messages:
Job for myshutdownmesg.service failed because the control process exited with error code.
See "systemctl status myshutdownmesg.service" and "journalctl -xeu myshutdownmesg.service" for details.
What's wrong with my script? Am I missing something? Since this is a script meant to be executed at shutdown time, do I need to pass any special parameters to the kernel or recompile it? BTW, I have SeLinux disabled, but will enable it later on after getting my script to run.
user729048
(11 rep)
Apr 5, 2025, 08:28 PM
• Last activity: Apr 16, 2025, 09:31 AM
1
votes
1
answers
160
views
How do I keep Fedora to try to suspend my system when idle?
I have a Fedora Linux system under my desk at home. It runs the Workstation setup (with GNOME) even though it mostly is used headless. It is my file server (samba), mail server (dovecot, mailman) and webserver (apache, perl-cgi). But recently,I am using digiKam to manage my photo connection, and I d...
I have a Fedora Linux system under my desk at home. It runs the Workstation setup (with GNOME) even though it mostly is used headless. It is my file server (samba), mail server (dovecot, mailman) and webserver (apache, perl-cgi). But recently,I am using digiKam to manage my photo connection, and I do this from a GNOME session.
When I upgraded to Fedora 40,
started shutting down (suspending) the system when idle, which of course prevented my server services from accepting connections. I fixed this with mask suspend
and mask sleep
. But recently, this is not enough: When I am logged in remotely by
, I will get interrupted every minute or so with
Broadcast message from root@cleo.beagle-ears.com (Mon 2025-04-14 15:07:31 PDT):
The system will suspend now!
How do I get rid of this?
Lars Poulsen
(357 rep)
Apr 14, 2025, 10:12 PM
• Last activity: Apr 15, 2025, 10:46 PM
2
votes
1
answers
542
views
How do I enable hibernate for all users (no sudo)?
I managed to resize my LVM partitions, set up my swapfile, and disable secure boot, so now I can hibernate with `sudo systemctl hibernate`. However, I want to be able to hibernate from my power menu (`wlogout`) without needing to use `sudo`. The `systemctl` commands `suspend`, `r...
I managed to resize my LVM partitions, set up my swapfile, and disable secure boot, so now I can hibernate with
sudo systemctl hibernate
. However, I want to be able to hibernate from my power menu (wlogout
) without needing to use sudo
. The systemctl
commands suspend
, reboot
, and poweroff
all work without needing sudo
. Why does hibernate
require sudo
, and is there a way to drop it,
so I don't need to interact via the command line for this one power option?
Using:
- Ubuntu 24.04 LTS
- Sway WM (not GNOME)
Hari
(130 rep)
Jun 7, 2024, 03:01 AM
• Last activity: Apr 10, 2025, 04:22 PM
54
votes
1
answers
17985
views
One systemctl command to both start and enable
Using one command to both start and enable `systemctl` managed software would be useful to spare a few lines in a few scripts, making them a bit more aesthetic (not really a problem but a nice thing to have). Is there one `systemctl` command to both `start` and `enable` a program controlled by `syst...
Using one command to both start and enable
systemctl
managed software would be useful to spare a few lines in a few scripts, making them a bit more aesthetic (not really a problem but a nice thing to have).
Is there one systemctl
command to both start
and enable
a program controlled by systemctl
?
user149572
Jan 20, 2019, 10:00 PM
• Last activity: Apr 9, 2025, 01:19 PM
3
votes
0
answers
275
views
How do I RUN systemctl with udev rules?
I am trying to start a service with `systemctl` using a `udev` rule. ```SUBSYSTEM=="tty", ATTRS{manufacturer}=="Belkin USB PDA Adapter", ATTRS{serial}=="778452", RUN+="/usr/bin/systemctl start serial-getty@ttyUSB0.service"``` `syslog` on the failure: ``` Mar 23 18:04:39 pi4 kernel: [289664.631249] u...
I am trying to start a service with
systemctl
using a udev
rule.
=="tty", ATTRS{manufacturer}=="Belkin USB PDA Adapter", ATTRS{serial}=="778452", RUN+="/usr/bin/systemctl start serial-getty@ttyUSB0.service"
syslog
on the failure:
Mar 23 18:04:39 pi4 kernel: [289664.631249] usb 1-1.1: new full-speed USB device number 13 using xhci_hcd
Mar 23 18:04:39 pi4 kernel: [289664.781515] usb 1-1.1: New USB device found, idVendor=050d, idProduct=0109, bcdDevice= 1.02
Mar 23 18:04:39 pi4 kernel: [289664.781534] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 23 18:04:39 pi4 kernel: [289664.781550] usb 1-1.1: Manufacturer: Belkin USB PDA Adapter
Mar 23 18:04:39 pi4 kernel: [289664.781565] usb 1-1.1: SerialNumber: 778452
Mar 23 18:04:39 pi4 kernel: [289664.786461] mct_u232 1-1.1:1.0: MCT U232 converter detected
Mar 23 18:04:39 pi4 kernel: [289664.786747] usb 1-1.1: MCT U232 converter now attached to ttyUSB0
Mar 23 18:04:48 pi4 systemd: dev-ttyUSB0.device: Job dev-ttyUSB0.device/start timed out.
Mar 23 18:04:48 pi4 systemd: Timed out waiting for device /dev/ttyUSB0.
Mar 23 18:04:48 pi4 systemd: Dependency failed for Serial Getty on ttyUSB0.
Mar 23 18:04:48 pi4 systemd: serial-getty@ttyUSB0.service: Job serial-getty@ttyUSB0.service/start failed with result 'dependency'.
Mar 23 18:04:48 pi4 systemd: dev-ttyUSB0.device: Job dev-ttyUSB0.device/start failed with result 'timeout'.
Mar 23 18:04:48 pi4 systemd-udevd: Process '/usr/bin/systemctl start serial-getty@ttyUSB0.service' failed with exit code 1.
When I manually run systemctl start serial-getty@ttyUSB0.service
, the service starts just fine.
Is there something obvious I am doing wrong to RUN+=
this in my udev
rule?
Albert Elmore
(85 rep)
Mar 23, 2023, 11:14 PM
• Last activity: Apr 9, 2025, 11:00 AM
0
votes
0
answers
23
views
Degraded status in Crostini container after Developer config and SSH config
`systemctl status` shows a `Degraded` state after following Chromeos Development Docs associated with and tweaking the ssh and sshd_config. I've got info about my Build&Machine specs and setup sharing&external guest and Host file&media I worked with `journalctl -xe` and failed status states found th...
systemctl status
shows a Degraded
state after following Chromeos Development Docs associated with and tweaking the ssh and sshd_config. I've got info about my Build&Machine specs and setup sharing&external guest and Host file&media
I worked with journalctl -xe
and failed status states
found the cros-port-listener.service
failures
I ran --rotate
to generate fresh logs associated with Container restarts with the same Degraded
status.
Aaron Sullivan
(1 rep)
Apr 8, 2025, 06:13 PM
• Last activity: Apr 8, 2025, 06:28 PM
8
votes
2
answers
1028
views
hostnamectl: source of Firmware Age
When I run `hostnamectl` command, I get this output: $ hostnamectl Static hostname: myhostname Icon name: computer-desktop Chassis: desktop 🖥 Machine ID: 12345e09a3a2464689c345fe7b12345f Boot ID: 123451b9f31ff4c166f8368c1f86666ad Operating System: openSUSE Leap 15.6 CPE OS Name: cpe:/o:opens...
When I run
hostnamectl
command, I get this output:
$ hostnamectl
Static hostname: myhostname
Icon name: computer-desktop
Chassis: desktop 🖥
Machine ID: 12345e09a3a2464689c345fe7b12345f
Boot ID: 123451b9f31ff4c166f8368c1f86666ad
Operating System: openSUSE Leap 15.6
CPE OS Name: cpe:/o:opensuse:leap:15.6
Kernel: Linux 6.4.0-150600.23.33-default
Architecture: x86-64
Hardware Vendor: ASRock
Hardware Model: B450 Pro4 R2.0
Firmware Version: P5.60
Firmware Date: Thu 2022-10-20
Firmware Age: 2y 5month 2w 3d <<<<<<<<<< this
I wonder: where does Firmware Age
comes from? I don't know of any other command that can return this value. How and from where does hostnamectl
get this value?
user19315471
(182 rep)
Apr 6, 2025, 07:53 PM
• Last activity: Apr 7, 2025, 07:05 AM
Showing page 1 of 20 total questions