How to enable guake at startup using systemd - linux

i made my service
/etc/systemd/system/guake.service
containing
[Unit]
Description=Start guake
[Service]
ExecStart=/bin/bash guake
[Install]
WantedBy=graphical.target
then i did
systemctl start guake.service
systemctl status guake.service
but i get
● guake.service - Start guake
Loaded: loaded (/etc/systemd/system/guake.service; enabled; vendor preset: disabled)
Active: failed (Result: core-dump) since Thu 2015-07-16 21:14:36 SAST; 4s ago
Process: 10785 ExecStart=/bin/bash guake (code=dumped, signal=SEGV)
Main PID: 10785 (code=dumped, signal=SEGV)
Jul 16 21:14:36 tawanda-pc bash[10785]: /usr/lib/python2.7/site-packages/gtk-2.0/gtk/init.py:57: GtkWarning: could...isplay
Jul 16 21:14:36 tawanda-pc bash[10785]: warnings.warn(str(e), _gtk.Warning)
Jul 16 21:14:36 tawanda-pc bash[10785]: /usr/lib/python2.7/site-packages/keybinder/init.py:26: GtkWarning: IA__gdk...failed
Jul 16 21:14:36 tawanda-pc bash[10785]: from _keybinder import *
Jul 16 21:14:36 tawanda-pc bash[10785]: /usr/lib/python2.7/site-packages/keybinder/init.py:26: GtkWarning: IA__gdk...failed
Jul 16 21:14:36 tawanda-pc bash[10785]: from _keybinder import *
Jul 16 21:14:36 tawanda-pc systemd[1]: guake.service: Main process exited, code=dumped, status=11/SEGV
Jul 16 21:14:36 tawanda-pc systemd[1]: guake.service: Unit entered failed state.
Jul 16 21:14:36 tawanda-pc systemd[1]: guake.service: Failed with result 'core-dump'.
Jul 16 21:14:36 tawanda-pc systemd-coredump[10790]: Process 10785 (python2) of user 0 dumped core.
Hint: Some lines were ellipsized, use -l to show in full.
I also tried setting WantedBy=multi-user.target but it has the same error
i am runnig arch linux, how do i get this to startup, thanks all

systemctl enable guake.service
cf https://wiki.debian.org/systemd

Related

Systemd does not activate service?

I need to leave a service on systemd running because it doesn't activate? For what reason this happens since I follow the recommendation of the documentation, below are the codes:
Code of the Service :
# Contents of /etc/systemd/system/quark.service
[Unit]
Description=Quark
After=network.target
[Service]
Type=simple
User=cto
ExecStart=/usr/local/bin/python3.9 /var/net/
Restart=always
[Install]
WantedBy=multi-user.target
Status Code :
● quark.service - Quark
Loaded: loaded (/etc/systemd/system/quark.service; enabled; vendor preset: en
Active: failed (Result: exit-code) since Mon 2021-06-21 15:20:34 UTC; 8s ago
Process: 1467 ExecStart=/usr/local/bin/python3.9 /var/net/ (code=exited, statu
Main PID: 1467 (code=exited, status=1/FAILURE)
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Main process exited, code=e
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Service RestartSec=100ms ex
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Scheduled restart job, rest
Jun 21 15:20:34 webstrucs systemd[1]: Stopped Quark.
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Start request repeated too
Jun 21 15:20:34 webstrucs systemd[1]: quark.service: Failed with result 'exit-co
Jun 21 15:20:34 webstrucs systemd[1]: Failed to start Quark.
The ExecStart should be the command to be executed:
systemd manpages:
ExecStart=
Commands with their arguments that are executed when this service is started.
This stanza:
ExecStart=/usr/local/bin/python3.9 /var/net/
Should be:
ExecStart=/usr/local/bin/python3.9 path_to_python_script.py

How to auto-mount veracrypt device-hosted volume with systemd after login on Linux Mint?

I created /etc/systemd/system/veracrypt-automount-devices.service:
[Unit]
Description=VeraCrypt auto-mount device-hosted volumes
[Service]
Type=forking
ExecStartPre=/bin/sleep 300
ExecStart=/usr/bin/veracrypt --auto-mount=devices /media/veracrypt1
[Install]
WantedBy=multi-user.target
Then I did:
sudo systemctl daemon-reload
sudo systemctl enable veracrypt-automount-devices
sudo systemctl status veracrypt-automount-devices
● veracrypt-automount-devices.service - VeraCrypt auto-mount device-hosted volumes
Loaded: loaded (/etc/systemd/system/veracrypt-automount-devices.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sat 2020-06-06 17:28:59 CEST; 8min ago
Process: 967 ExecStartPre=/bin/sleep 300 (code=killed, signal=TERM)
Jun 06 17:27:29 username-computername systemd[1]: Starting VeraCrypt auto-mount device-hosted volumes...
Jun 06 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Start-pre operation timed out. Terminating.
Jun 06 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'timeout'.
Jun 06 17:28:59 username-computername systemd[1]: Failed to start VeraCrypt auto-mount device-hosted volumes.
As you can see, it doesn't work.
If I grep syslog, here is what I find:
Jun 6 16:56:08 username-computername systemd[1]: veracrypt-automount-devices.service: Control process exited, code=exited status=1
Jun 6 16:56:08 username-computername veracrypt[969]: Enter password:
Jun 6 16:56:08 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'exit-code'.
Jun 6 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Start-pre operation timed out. Terminating.
Jun 6 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'timeout'.
Basically, what I want is to be asked for the password to decrypt the device-hosted volume after I logged in with my username and password in Linux Mint.
I found how to do it. I put the veracrypt command in ~/.profile to execute the program on login. See https://askubuntu.com/a/270050/787567.

Systemd service enabled but does not start

I have a custom Spring Boot web application running on a Linux virtual machine. I have a systemd script to start/restart the application.
I have tried changing to WantedBy=default.target and it still does not work. I have tried adding After or Type and still does not work
[Unit]
Description=SpringBootSampleApp
[Service]
WorkingDirectory=/home/mecpro
ExecStop=/usr/bin/sudo /home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war
ExecStart=/usr/bin/sudo /home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war
[Install]
WantedBy=multi-user.target
My console screen looks like this
Loaded: loaded (/etc/systemd/system/webapp.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-08-12 13:26:27 UTC; 22ms ago
Main PID: 9104 (sudo)
Tasks: 2 (limit: 4675)
When I run systemctl status webapp.service, I get this
webapp.service - SpringBootSampleApp
Loaded: loaded (/etc/systemd/system/webapp.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-08-12 13:26:27 UTC; 3min 17s ago
Process: 9104 ExecStart=/usr/bin/sudo /home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war (code=exited, status=2)
Main PID: 9104 (code=exited, status=2)
Aug 12 13:26:28 x01133361 sudo[9104]: /home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war: 2: /home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war: Syntax error: "(" unexpected
Aug 12 13:26:27 x01133361 systemd[1]: Started SpringBootSampleApp.
Aug 12 13:26:27 x01133361 systemd[1]: webapp.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 12 13:26:27 x01133361 systemd[1]: webapp.service: Failed with result 'exit-code'.
Aug 12 13:26:27 x01133361 sudo[9104]: root : TTY=unknown ; PWD=/home/mecpro ; USER=root ; COMMAND=/home/mecpro/webapp/webapp-0.0.1-SNAPSHOT.war
Aug 12 13:26:27 x01133361 sudo[9104]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 12 13:26:27 x01133361 sudo[9104]: pam_unix(sudo:session): session closed for user root
This is my first question on StackOverflow so kindly excuse if the question is badly formatted. Thanks in advance.

systemd server isn't started

I am running this systemd command but when I screen -ls I don't see the screen.
The status is active and seems well.
But it isn't actually running when I check.
This is the .service file
[Unit]
Description=webhookdaemon
[Service]
ExecStart=/bin/bash path/to/script
RemainAfterExit=yes
Type=forking
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
Here is the script (path/to/script)
screen -S docker-hub-daemon -d -m npm run start --prefix /root/nodeserver/
Here is the status output
webookdaemon.service - webhookdaemon
Loaded: loaded (/etc/systemd/system/webookdaemon.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2018-03-13 19:55:15 UTC; 57min ago
Main PID: 2144 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/webookdaemon.service
Mar 13 19:58:29 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 19:59:03 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:00:22 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:01:21 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:02:26 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:04:41 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:47:41 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:49:53 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
Mar 13 20:52:53 aggregate-terminal-logs-tor1-01 systemd[1]: Started webhookdaemon.
root#aggregate-terminal-logs-tor1-01:~#
You should not be using screen to manage services. Just use systemd directly.
Make sure that Type= is set match the behavior of the service you are lauching. I could not find references to docker-hub-daemon, so I'm not sure the appropriate value for it. See man systemd.service for the documentation for Type=.
Instead of using screen -ls to check the status of the service, use systemctl status webookdaemon.
You may also wish to update the spelling of this service to be webhoookdaemon to match the spelling in the description.

Can't set "max connections" - parameter of memcached higher than 4096 (exited status 71)

My start parameter for memcached are:
-m 900 -p 11211 -t 5 -l 127.0.0.1 -r 200000 -c 4096
If "-c" (max connections) is more than 4096, memcached won't start.
memcached.service - memcached daemon
Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled)
Active: failed (Result: exit-code) since Mon 2014-10-13 13:25:15 CEST; 17s ago
Process: 17667 ExecStart=/usr/sbin/memcached $MEMCACHED_PARAMS (code=exited, status=71)
Main PID: 17667 (code=exited, status=71)
Oct 13 13:25:15 openSUSE-131-64-minimal systemd[1]: Starting memcached daemon...
Oct 13 13:25:15 openSUSE-131-64-minimal systemd[1]: Started memcached daemon.
Oct 13 13:25:15 openSUSE-131-64-minimal systemd[1]: memcached.service: main process exited, code=exited, status=71/n/a
Oct 13 13:25:15 openSUSE-131-64-minimal systemd[1]: Unit memcached.service entered failed state.
Does someone know what could cause these problem?

Resources