Questions tagged as ['services']
I have written a simple python script that sends notifications using Pushbullet. The command works perfectly in the terminal but does not work automatically. The syslog for Cron:
Nov 29 18:33:01 ubuntu CRON[4255]: (root) CMD (usr/bin/python3 IdeaProjects/TradingScript/src/test.py >/dev/null 2>&1)
Nov 29 18:34:01 ubuntu CRON[4266]: (root) CMD (/usr/bin/python3 IdeaProjects/TradingScript/s ...
I have below systemd service:
[Unit]
Description=Python Code
Requisite=mosquitto.service
BindsTo=mosquitto.service
[Service]
Type=simple
User=andrew
ExecStart=/usr/bin/python3 /home/andrew/Documents/main.py
Restart=always
RestartSec=10s
StandardOutput=null
[Install]
WantedBy=multi-user.target
Above service is running fine. As mentioned above, it depends on mosquitto
so if mosquitto stops, service ...
Man page of service command: For systemd units, start, stop, status, and reload are passed through to their systemctl/initctl equivalents.
Does this mean for systemd units the service command use systemctl?

I was auditing my computer (with lynis) and then I saw that I have bad security on almost all of my services when I run "sudo systemd-analyze security SERVICE". I was wondering if there was a way to harden them, how do I do it? Also is there a way to auto harden them?
Thanks to everyone who helps :)!

after editing the file "/etc/apache2/sites-available/default-ssl.conf", I noticed that my site was running much slower, so I rewrote the file from 0 with this (htps:/gist.github.com/hephaestus9/2a8562137841c99a74cb) which should be the original file. After that, the terminal, when launching the command "sudo service apache2 start", gave this error message "sudo service apache2 start Job for apache2.serv ...

I have a script that is running as root and am trying to have it setup a user service to run an IPFS daemon. The problem is that I need to enable the service as the user rather than as root. It usually works after a restart but I'd like to avoid that if I can.
The service script is located at ~/.config/systemd/user/ipfs.service
It contains:
[Unit]
Description=IPFS daemon
[Service]
# Environment="IPFS_PA ...
I have rTorrent running as a daemon on my headless server, but I can't access the UI in any obvious way per the config or instructions online. I'd like to be able to pass in magnet links and manage the current torrent files using the UI, but be able to let it run seeding/downloading torrents outside of my ssh session. Unless I'm missing something obvious, I see three options for how to address this prob ...

Using system-d: I have 2 services (Service A and Service B). Service B needs Service A to always be running. If service A ever crashes or is stopped, Service B should also be immediately stopped until service A is restored (At which point in time service B should start back up automatically). Is there a directive that can be put into the system.d unit files to force this type of a relationship?
...
I have my golang program running as root service and I am trying to set the proxy setting using the gsettings command in my program. I am able to read these settings in my golang program using the following command code in golang:
u, erru:= user.Lookup("dimdimuser")
if erru != nil {
return "",fmt.Errorf("unknown user info")
}
uid, err = strconv.ParseInt(u.Uid, 10, 32)
gid, err = strconv.ParseInt(u ...
I've followed this guide 3 times and every time I've destroyed the VM and started fresh.
SoftEther service is not starting automatically after reboot. Manual start works fine.
I'm not a seasoned Ubuntu admin, so please help me to find out how to check the log to see if there's any startup error.
Thanks.
Please forgive what may seem like a naive question. I have 30+ years in windows development and IT management, but rarely use Linux. I have an elderly laptop with only 4Gb mem and 4 core @ 2.53Ghz... I originally installed Ubuntu 14ish years ago and it's been a pretty stable box, I have kept up with distro upgrades and from about v19 on up i've noticed a performance and stability hit. currently 21.04 GN ...
I am running Ubuntu in a VM for the purpose of having a local Wordpress installation, needed to do some local testing.
To this end I configured this machine's networking mode in VirtualBox to bridged, configured my home router to always lease the same IP address (192.168.0.101
) to the MAC address of this VM and configured Apache to listen on this address in etc/apache2/ports.conf
:
Listen 192.168.0.101:80
...
I have a java application with 4 processes running (on Ubuntu 20.04LTS), ref below picture. Service 1 starts before 2+, Service 2 would also start service 3 and 4. I've setup 1 and 2 as simple and that works.
service dependencies, service 2 starting service 3 and 4
However, service 3 and 4 can be stopped/restarted independently of service 2. Is there a way to implement this into the service defini ...

I make service file, vaultwarden.service to look like this (here showing just part of it):
# The user/group vaultwarden is run under. the working directory (see below) should allow write and read access to this user/group
User=vaultwarden
Group=vaultwarden
# The location of the compiled binary
ExecStart=/home/vaultwarden/vaultwarden # user is vaultwarden, binary vaultwarden
When in service file part ...
Recently i notice problem when i try one tutorial with nginx and nginx. I cannot check service using sudo systemctl status
for any service at my Ubuntu 20.04
for example check docker.service
sudo systemctl status docker.service
It is not problem to execute other systemctl commands like sudo systemctl enable docker.service
etc....
What i could check for this strange appearance? exist alternative to che ...
I've tried enabling and restarting both services but they continually fail, even on reboot.
The job identifier is 110800.
Oct 12 19:14:36 [server] pcp[2555877]: pmie_daily failed - see /var/log/pcp/pmie/pmie_daily.log
Oct 12 19:14:36 [server] systemd[1]: pmie_daily.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://w ...
I want to run a simple command after my ubuntu starts up and network services are established (it should do so no matter wheater I'm logged in or not)
If I run the command manually, it start's up the enclosed applications: confluent local services start
. So it works at least with my user.
Questions:
- How can I run the command on system startup (after network is esablished)?
- To any solutions suggested, how ...
ok, I understand what the power management daemon does on a laptop, conserving battery power by scaling down the cpu, and dimming the screen. On a desktop however, is the power management daemon necessary? (as in, is there anything else I am not thinking of, before I turn this off?)

I am using the RealVNC server which uses vncserver-x11-serviced
. According to the documentation, one can run the daemon at startup using systemctl enable vncserver-x11-serviced.service
command.
How to make it run before a user logs in to the account?
This is necessary when you reboot the system. In that case, the RealVNC server does not start listening until one actually logs in to the system which ...
I have a Linux service running on my ubuntu machine. in this machine, I need to read proxy setting environment variables ( like https_proxy, http_proxy, no_proxy, etc) values for the currently logged-in user.
when I am trying to read https_proxy from my service code, it is being printed as an empty string but when I am printing from the terminal the values are correct.
I think the service is not abl ...
I have an unattended script for installing servers. At the beginning of the script there is a sudo apt-get dist-upgrade --yes
.
The dist upgrade has a nasty user input screen at its end asking to restart services:
Is it possible to autoaccept service restarts or disable this screen? It breaks my whole script. Also Im afraid it might leave my server stuck at some point when updating...
same result w ...
After uninstalling:
> ps aux | grep redis-server
root 147242 0.7 0.0 52968 7824 ? Ssl 16:58 0:00 /snap/redis/137/usr/bin/redis-server *:6379
stavalfi 147321 0.0 0.0 17672 672 pts/0 S+ 16:58 0:00 grep --color=auto redis-server
When I kill one of the pids (kill <pid>
or sudo service redis-server stop
or sudo systemctl unmask redis-server.service && kill ...
I have a metered Wifi connection that has lately started reaching the prepaid data limit faster than I expect. To figure out what specifically is using up bandwidth, I installed ipfm 0.11.5-4.2 with apt-get from the universe repository on my Ubuntu 21.04 system. I read through the man pages, configured ipfm.conf and ran the daemon for a few hours, and everything seemed to work as I expected. I got hourl ...
I have been puzzling over this one for a while now and I have managed to refine my issue to one problem. I have a service which is supposed to run a shell script to start daemon processes (using nohup), these processes are discord bots written using nodejs and discordjs. Currently I have a service that starts the test discord bot when I run it using sudo systemctl start startdiscordbots
and that work ...
I'm deploying a ASP .Net core app to my webserver. When I run the systemd service it binds to port 5000 and I get a nginx 502 error. When I run the service manually using "dotnet Activecalls.dll" it binds to port 5001 for https which is what I want and the website works correctly. Here is the systemd service:
[Unit]
Description=Active Calls Service
[Service]
WorkingDirectory=/var/ActiveCalls
ExecS ...
I am provided by a VM running Ubuntu 18.04.5 LTS which has systemd disabled.
I have root access on it.
I am trying to run docker on it which is installed but I get error
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I cannot run systemctl
as I get error
System has not been booted with systemd as init system (PID 1). Can't operate.
I ran the comm ...