par défaut depuis Ubuntu 15.04
http://www.howtogeek.com/216454/how-to-manage-systemd-services-on-a-linux-system/
exemple : systemctl disable apache2.service

gestion des services de dev

https://doc.ubuntu-fr.org/creer_un_service_avec_systemd#exemples_de_services_et_leur_fichier_de_configuration
/root/bin/dev.sh

#!/bin/bash

if [ $1 == "start" ] || [ $1 == "stop" ] || [ $1 == "reload" ] || [ $1 == "restart" ] || [ $1 == "enable" ] || [ $1 == "disable" ]
then
	action=$1
else
	echo "invalid action"
	exit 1
fi

systemctl $action apache2
systemctl $action php7.2-fpm
systemctl $action mysql
systemctl $action postgresql

/etc/systemd/system/dev.service

[Unit]
Description=DEV services

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/root/bin/dev.sh start
ExecStop=/root/bin/dev.sh stop
ExecReload=/root/bin/dev.sh reload

désactivation du démarrage de ces services :
systemctl daemon-reload
systemctl stop dev
systemctl disable dev

activation des services de dev à la demande :
systemctl start dev

  • systemd.txt
  • Dernière modification: 2023/05/08 01:41
  • de 127.0.0.1