![루트 프로세스에서 사용자와 통신하는 방법](https://linux55.com/image/179371/%EB%A3%A8%ED%8A%B8%20%ED%94%84%EB%A1%9C%EC%84%B8%EC%8A%A4%EC%97%90%EC%84%9C%20%EC%82%AC%EC%9A%A9%EC%9E%90%EC%99%80%20%ED%86%B5%EC%8B%A0%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
cron.daily
로그인한 사용자에게 결과를 보내야 하는 루트로 실행되는 프로세스가 있습니다 .
wall
또는 와 유사한 X 버전이 있습니까 write
? mail
사용자에게 너무 복잡할 수 있으므로 이를 피하려고 합니다 .
세부 사항
저는 Windows 7을 사용하는 비기술적인 사용자를 위해 Linux Mint Cinnamon 노트북을 설정하고 있습니다. 바이러스 백신이 특별히 요청되었습니다.
스크립트는 cron.daily에 있습니다.
#!/bin/bash
# ClamAV antivirus maintenance.
LOGFILE=/var/log/av-results.txt
# Update the signature database. Populates the file /var/lib/clamav/daily.cvd
systemctl stop clamav-freshclam
freshclam
systemctl start clamav-freshclam
# Run a scan
clamscan --infected --recursive --log=$LOGFILE /home
if [[ $? -eq 1 ]]
then
wall "Virus(es) found. Call support"
fi
chmod 666 $LOGFILE
하지만 wall
사용자가 Cinnamon을 사용하지 않기 때문에 작동하지 않습니다 terminal
.
ClamTK
(GUI 버전 ClamAV
)은 작동할 수 없기 때문에 제외되었습니다.