takuya@:systemd$ ls -l /sbin/{start,reload,stop,restart,status}
ls: /sbin/start にアクセスできません: そのようなファイルやディレクトリはありません
ls: /sbin/reload にアクセスできません: そのようなファイルやディレクトリはありません
ls: /sbin/stop にアクセスできません: そのようなファイルやディレクトリはありません
ls: /sbin/restart にアクセスできません: そのようなファイルやディレクトリはありません
ls: /sbin/status にアクセスできません: そのようなファイルやディレクトリはありません
以前は
takuya@atom:~$ ls -l /sbin/{start,reload,stop,restart,status}
lrwxrwxrwx 1 root root 7 2011-05-06 02:11 /sbin/reload -> initctl
lrwxrwxrwx 1 root root 7 2011-05-06 02:11 /sbin/restart -> initctl
lrwxrwxrwx 1 root root 7 2011-05-06 02:11 /sbin/start -> initctl
lrwxrwxrwx 1 root root 7 2011-05-06 02:11 /sbin/status -> initctl
lrwxrwxrwx 1 root root 7 2011-05-06 02:11 /sbin/stop -> initctl
のようにコマンドはありました。今は見当たりません。
UpStart の知識は忘れたほうが良さそうです。service コマンドは残りそう
/etc/init ディレクトリ
以前は、/etc/init ディレクトリに upstart のジョブは置かれていました。また /etc/init.d はそのまま使えます。
いまでもなぜかssh.conf が私の環境には残っていました。これどっちで起動してるんだろう。。。
takuya@: $ cat /etc/init/ssh.conf
# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.
description "OpenSSH server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
env SSH_SIGSTOP=1
expect stop
# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
console none
pre-start script
test -x /usr/sbin/sshd || { stop; exit 0; }
test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
mkdir -p -m0755 /var/run/sshd
end script
# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D
rc にも残ってるだけどね。
takuya@:~$ ll /etc/rc5.d/ | grep ssh
33:lrwxrwxrwx 1 root root 13 2016-06-14 03:00 S03ssh -> ../init.d/ssh
どうやら、systemd の設定で起動しているようです。余り何も考えなくて良いのは楽ですね。
takuya@:systemd$ systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: active (running) since 土 2017-04-29 01:07:24 JST; 5 days ago
Main PID: 1029 (sshd)
CGroup: /system.slice/ssh.service
├─ 399 /bin/bash
├─ 445 vim .bash_aliases
├─ 1029 /usr/sbin/sshd -D
└─32630 /bin/bash
takuya@:~$ cat /lib/systemd/system/ssh.service
[Unit]
Description=OpenBSD Secure Shell server
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
[Service]
EnvironmentFile=-/etc/default/ssh
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
Alias=sshd.service
アップデートでファイルは残ったけど、そのへんはうまくやってると信じることにする。
Upstartは使えなくなるけど、 /etc/init に書いてたようなノノはそのまま使えるわけだ。助かる。