автозапуск autorun1

Ответить
ya
^-^
Сообщения: 2336
Зарегистрирован: 16 дек 2021, 19:56

автозапуск autorun1

Сообщение ya »

/etc/systemd/system/autorun1.service

Код: Выделить всё

[Unit]
Description=Autorun

[Service]
ExecStart=/root/autorun.sh
#Restart=always

[Install]
WantedBy=multi-user.target
/root/autorun.sh

Код: Выделить всё

#!/bin/bash

iptables-restore < /etc/iptables

exit 0
sudo systemctl daemon-reload
sudo systemctl enable autorun1
ya
^-^
Сообщения: 2336
Зарегистрирован: 16 дек 2021, 19:56

Re: автозапуск autorun1

Сообщение ya »

Список запущенных процессов:

Код: Выделить всё

systemctl list-units --type=service --state=running

Код: Выделить всё

pgrep -l процесс

Код: Выделить всё

ps aux | grep процесс
Убить процесс

Код: Выделить всё

sudo kill -9 pid
Ответить