はじめに
- macosでは,cron.logが出ないようなので,これを出すようにする.
/etc/syslog.confを確認
$ cat /etc/syslog.conf🆑
# Note that flat file logs are now configured in /etc/asl.conf
install.* @127.0.0.1:32376
# used for the adaptive firewall: man emlog.pl
auth.* @127.0.0.1:60762
syslog.confを編集
$ sudo cp -p /etc/syslog.conf /etc/syslog.conf.v00🆑
Password:🆑
$ ls -la /etc/syslog.conf*🆑
-rw-r--r-- 1 root wheel 200 2 4 2018 /etc/syslog.conf
-rw-r--r-- 1 root wheel 200 2 4 2018 /etc/syslog.conf.v00🈁
-rw-r--r-- 1 root wheel 96 2 26 2016 /etc/syslog.conf~previous
$ cat /etc/syslog.conf🆑
# Note that flat file logs are now configured in /etc/asl.conf
install.* @127.0.0.1:32376
# used for the adaptive firewall: man emlog.pl
auth.* @127.0.0.1:60762
#cron log🈁
cron.* /var/log/cron.log🈁
$ diff /etc/syslog.conf.v00 /etc/syslog.conf🆑
6a7,8
> #cron log
> cron.* /var/log/cron.log
$
反映させる
$ sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist🆑
/System/Library/LaunchDaemons/com.apple.syslogd.plist: Operation not permitted while System Integrity Protection is engaged🈁
$
- 今回はmacos 10.3のHigh Sierraで試したが,El Capitan(10.11)以降に搭載された,System Integrity Protectionが効いてしまって,残念ながら反映できない.
- 本来なら,次のようなコマンドでsyslogdを再起動できる.(今回はメモ)
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist