Questions tagged [systemctl]

systemctl is used to control the systemd system and service manager.

systemctl can be used to control the systemd system/service manager.

Reference: http://www.dsm.fordham.edu/cgi-bin/man-cgi.pl?topic=systemctl

503 questions
7
votes
1 answer

Go can't find file while running as a systemctl service on Ubuntu

I have a Go app, and I'm trying to run it as a systemctl service (Ubuntu 18.04). I'm using godotenv: func init() { var env map[string]string env, err := godotenv.Read() if err != nil { panic(err) } } I have my .env file in…
Tarasovych
  • 2,228
  • 3
  • 19
  • 51
7
votes
2 answers

docker archlinux image: System has not been booted with systemd as init system (PID 1). Can't operate

I am using archlinux/base official image from docker hub. I am trying to use systemctl and it says. $ docker run --rm -it ac16c4b756ed systemctl start httpd System has not been booted with systemd as init system (PID 1). Can't operate. How to…
Santhosh
  • 9,965
  • 20
  • 103
  • 243
7
votes
2 answers

How to install 'systemctl' on Ubuntu (docker)?

I have a docker with Ubuntu 16.04 and trying to install mysql-server in it. Installation went fine (apt-get install -y mysql-server) and now is time to run a server: systemctl status mysql Failed to connect to bus: No such file or directory How to…
Joe
  • 11,983
  • 31
  • 109
  • 183
6
votes
3 answers

systemctl not found while building mongo image

I am trying to build a mongo 4.4 image based on the official image Dockerfile but I am running into an issue with systemctl not found. The image itself has a line to remove it after setup, but not sure where it came from. Any ideas? Setting up…
haytham
  • 502
  • 4
  • 22
6
votes
2 answers

systemd - how to access current user name from system service?

I want to create system service, which (for each user) will be started just after user login and do some job inside user's $HOME with root privelegies. Here is sample service: [Unit] Description= My User…
RocketLaunch
  • 61
  • 1
  • 3
6
votes
3 answers

systemctl service systemd-notify not working with non-root user

I have a simple example of a service unit and bash script on Red Hat Enterprise Linux 7 using Type=notify that I am trying to get working. When the service unit is configured to start the script as root, things work as expected. When adding…
Brian
  • 61
  • 1
  • 2
6
votes
1 answer

Resolve systemd alias (service name)

Systemd supports aliases. For example "httpd.service" ls -l /etc/systemd/system/httpd.service /etc/systemd/system/httpd.service -> /usr/lib/systemd/system/apache2.service Content of this file: [Unit] Description=The Apache…
guettli
  • 25,042
  • 81
  • 346
  • 663
6
votes
2 answers

Can't restart webmin [status 2]

I've updated webmin, but now, it refuse to restart : ● webmin.service - LSB: web-based administration interface for Unix systems Loaded: loaded (/etc/init.d/webmin; generated; vendor preset: enabled) Active: failed (Result: exit-code) since Sun…
Sowdowdow
  • 409
  • 1
  • 3
  • 13
6
votes
0 answers

systemd: recover from systemctl hang

I have a custom systemd ".service" file, like this…
Daniel Cantarin
  • 319
  • 3
  • 7
5
votes
2 answers

getting uptime or downtime of systemd process using systemctl?

like using systemctl is-active gives is if service is active or failed then is it possible to get the uptime or downtime of the systemd service all using systemctl ? time systemctl status kdm|cat * kdm.service - LSB: X display manager…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
5
votes
1 answer

amazonlinux:2 systemctl Failed to get D-Bus connection

I would like to use this image https://hub.docker.com/_/amazonlinux to script my EC2 machine Here is my Dockefile : FROM amazonlinux:2 MAINTAINER "xxxxx" RUN yum -y update RUN yum -y install httpd WORKDIR /var/www/html CMD […
bingo
  • 150
  • 3
  • 10
5
votes
1 answer

Daemonization celery in production

I'm trying to run Celery as service in Ubuntu 18.04, using Django 2.1.1 and Celery 4.1.1 that is installed in env and Celery 4.1.0 installed systemwide. I'm going forward with this tutorial to run Celery as service. Here is my Django's project…
mehdi
  • 1,100
  • 1
  • 11
  • 27
5
votes
4 answers

how to get individual values from the output of systemctl status

[root@localhost etc]# systemctl status blu_av ● blu_av.service - avscan Loaded: loaded (/etc/systemd/system/blu_av.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2018-03-16 16:31:14 IST; 3s ago Main PID: 31934…
user9279273
  • 75
  • 1
  • 1
  • 12
5
votes
3 answers

systemd: Stop dependent service when main service crashes

(systemd version 229) I have a primary service A, and a secondary service B. The primary A can run by itself. But service B cannot run correctly by itself: it needs A to be running (technically B can run, but this is what I want systemd to…
Uncle Spook
  • 159
  • 1
  • 3
5
votes
1 answer

Can't start mosquitto on raspbian jessie using systemctl

First did this: systemctl stop mosquitto update-rc.d mosquitto remove rm /etc/init.d/mosquitto Unit file as follows: [Unit] Description=MQTT v3.1 message…
Alex
  • 2,270
  • 3
  • 33
  • 65
1 2
3
33 34