Debian 3.16.0-4-amd64, не находит unit

Compilation and installation questions and stories
Post Reply
vini
Posts: 4
Joined: 05 Apr 2017, 09:03

Debian 3.16.0-4-amd64, не находит unit

Post by vini » 05 Apr 2017, 09:10

Доброе время суток
устанавливаю accel-ppp для pppoe сервера
По данному мануалу
Unit скопировал в /etc/systemd/system/multi-user.target.wants

Code: Select all

[Unit]
Description=Accel-PPP
After=network.target

[Service]
ExecStart=/usr/sbin/accel-pppd -d -p /var/run/accel-pppd.pid -c /etc/accel-ppp.conf
StandardOutput=null
ExecReload=/bin/kill -SIGUSR1 $MAINPID
PIDFile=/var/run/accel-pppd.pid
Type=forking
Restart=always

[Install]
WantedBy=multi-user.target
Alias=accel-ppp-init.service
/usr/sbin/accel-pppd заменил на /usr/local/sbin/accel-pppd

Code: Select all

root@debbi:~# cat /etc/init.d/accel-ppp-init
#!/bin/sh
# /etc/init.d/accel-pppd: set up the accel-ppp server
### BEGIN INIT INFO
# Provides:          accel-ppp
# Required-Start:    $remote_fs $syslog $network $time
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin

. /lib/lsb/init-functions

if test -f /etc/default/accel-ppp; then
    . /etc/default/accel-ppp
fi

if [ -z "$ACCEL_PPPD_OPTS" ]; then
  ACCEL_PPPD_OPTS="-c /etc/accel-ppp.conf"
fi

case "$1" in
  start)
        log_daemon_msg "Starting PPtP/L2TP/PPPoE server" "accel-pppd"
        if start-stop-daemon --start --quiet --oknodo --exec /usr/local/sbin/accel-pppd -- -d -p /var/run/accel-pppd.pid $ACCEL_PPPD_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
  ;;
  restart)
        log_daemon_msg "Restarting PPtP/L2TP/PPPoE server" "accel-pppd"
        start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pppd.pid
        if start-stop-daemon --start --quiet --oknodo --exec /usr/local/sbin/accel-pppd -- -d -p /var/run/accel-pppd.pid $ACCEL_PPPD_OPTS; then
            log_end_msg 0
        else
            log_end_msg 1
        fi
  ;;

  stop)
        log_daemon_msg "Stopping PPtP/L2TP/PPPoE server" "accel-pppd"
        start-stop-daemon --stop --quiet --oknodo --retry 180 --pidfile /var/run/accel-pppd.pid
        log_end_msg 0
  ;;

  status)
        status_of_proc /usr/local/sbin/accel-pppd "accel-pppd"
  ;;
  *)
    log_success_msg "Usage: /etc/init.d/accel-ppp {start|stop|status|restart}"
    exit 1
    ;;
esac

exit 0
http://eth0.pro/post/20
/etc/init.d/accel-ppp-init start
[....] Starting accel-ppp-init (via systemctl): accel-ppp-init.serviceFailed to start accel-ppp-init.service: Unit accel-ppp-init.service failed to load: No such file or directory.
failed!
В чем загвоздка ?

dimka88
Posts: 243
Joined: 13 Oct 2014, 05:51
Contact:

Re: Debian 3.16.0-4-amd64, не находит unit

Post by dimka88 » 05 Apr 2017, 10:14

Покажите вывод systemctl status accel-ppp-init.service

vini
Posts: 4
Joined: 05 Apr 2017, 09:03

Re: Debian 3.16.0-4-amd64, не находит unit

Post by vini » 05 Apr 2017, 10:32

Code: Select all

root@debbi:~# systemctl status accel-ppp-init.service
● accel-ppp-init.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

dimka88
Posts: 243
Joined: 13 Oct 2014, 05:51
Contact:

Re: Debian 3.16.0-4-amd64, не находит unit

Post by dimka88 » 05 Apr 2017, 10:42

ls -lah /etc/systemd/system/multi-user.target.wants/accel-ppp-init.service

и cat /etc/systemd/system/multi-user.target.wants/accel-ppp-init.service

vini
Posts: 4
Joined: 05 Apr 2017, 09:03

Re: Debian 3.16.0-4-amd64, не находит unit

Post by vini » 05 Apr 2017, 11:08

Code: Select all

root@debbi:~# ls -lah /etc/systemd/system/multi-user.target.wants/accel-ppp.service
-rw-r--r-- 1 root root 327 апр  5 11:42 /etc/systemd/system/multi-user.target.wants/accel-ppp.service

Code: Select all

root@debbi:~# cat /etc/systemd/system/multi-user.target.wants/accel-ppp.service
[Unit]
Description=Accel-PPP
After=network.target

[Service]
ExecStart=/usr/sbin/accel-pppd -d -p /var/run/accel-pppd.pid -c /etc/accel-ppp.conf
StandardOutput=null
ExecReload=/bin/kill -SIGUSR1 $MAINPID
PIDFile=/var/run/accel-pppd.pid
Type=forking
Restart=always

[Install]
WantedBy=multi-user.target
Alias=accel-ppp.service


dimka88
Posts: 243
Joined: 13 Oct 2014, 05:51
Contact:

Re: Debian 3.16.0-4-amd64, не находит unit

Post by dimka88 » 05 Apr 2017, 11:29

Если используете systemd, то тогда уж по человечески =) Напутали с именами и расположением.
Перечитываем настройки systemctl

Code: Select all

systemctl daemon-reload
Запускаем accel-pppd

Code: Select all

systemctl start accel-ppp.service
Ну и там сморим состояние

Code: Select all

systemctl status accel-ppp.service
Добавляем в автозагрузку

Code: Select all

systemctl enable accel-ppp.service

vini
Posts: 4
Joined: 05 Apr 2017, 09:03

Re: Debian 3.16.0-4-amd64, не находит unit

Post by vini » 05 Apr 2017, 11:41

Спасибо заработало ) Почти все заработало )

Code: Select all

root@debbi:~# systemctl status accel-ppp.service
● accel-ppp-init.service - (null)
   Loaded: loaded (/etc/init.d/accel-ppp-init)
   Active: active (running) since Ср 2017-04-05 14:40:05 MSK; 6s ago
  Process: 6335 ExecStart=/etc/init.d/accel-ppp-init start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/accel-ppp-init.service
           └─6338 /usr/local/sbin/accel-pppd -d -p /var/run/accel-pppd.pid -c /etc/accel-ppp.conf

апр 05 14:40:05 debbi accel-ppp-init[6335]: Starting PPtP/L2TP/PPPoE server: accel-pppd.
апр 05 14:40:05 debbi systemd[1]: Started (null).
root@debbi:~# systemctl enable accel-ppp.service
Failed to execute operation: No such file or directory
root@debbi:~# systemctl enable accel-ppp.service

hugleo
Posts: 54
Joined: 13 Apr 2016, 14:28

Re: Debian 3.16.0-4-amd64, не находит unit

Post by hugleo » 05 Apr 2017, 12:56

Remove all files that you created. /etc/systemd/system/multi-user.target.wants/accel-ppp.service

and do:

cp accel-ppp.service /lib/systemd/system/accel-ppp.service
systemctl enable accel-ppp.service


my accel-ppp.service contents:

[Unit]
Description=Accel-PPP
After=network.target

[Service]
ExecStart=/usr/local/sbin/accel-pppd -d -p /var/run/accel-pppd.pid -c /etc/accel-ppp.conf
StandardOutput=null
ExecReload=/bin/kill -SIGUSR1 $MAINPID
PIDFile=/var/run/accel-pppd.pid
Type=forking
Restart=always

[Install]
WantedBy=multi-user.target
Alias=accel-ppp.service

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest