1. 程式人生 > 實用技巧 >kata agent install syslog

kata agent install syslog

root@ubuntu:/# chown man:root /var/cache/man -R
root@ubuntu:/# chmod g+s /var/cache/man -R

/usr/bin/mandb: can't chmod /var/cache/man/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/sl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/it/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/cs/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/ru/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/pl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/hu/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/tr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/sr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/nl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/zh_TW/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/ja/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/sv/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/pt/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/zh_CN/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/da/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/ko/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/es/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/fr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/id/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/fi/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/pt_BR/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/de/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/vi/CACHEDIR.TAG: Operation not permitted
Errors were encountered while processing:
rsyslog
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu:/# chown man:root /var/cache/man -R


root@ubuntu:/# chmod g+s /var/cache/man -R

apt-get install rsyslog

/usr/bin/mandb: fopen /var/cache/man/zh_CN/21754: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/da/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/da/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/da/21754
: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/ko/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/ko/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/ko/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/es/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can'
t remove /var/cache/man/es/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/es/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/fr/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/fr/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/fr/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/id/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/id/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/id/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/fi/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/fi/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/fi/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/pt_BR/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/pt_BR/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/pt_BR/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/de/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/de/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/de/21754: Permission denied /usr/bin/mandb: can't chmod /var/cache/man/vi/CACHEDIR.TAG: Operation not permitted /usr/bin/mandb: can't remove /var/cache/man/vi/CACHEDIR.TAG: Permission denied /usr/bin/mandb: fopen /var/cache/man/vi/21754: Permission denied Setting up cron (3.0pl1-128.1ubuntu1) ... Adding group `crontab' (GID 106) ... Done. Created symlink /etc/systemd/system/multi-user.target.wants/cron.service -> /lib/systemd/system/cron.service. update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults invoke-rc.d: could not determine current runlevel Setting up logrotate (3.11.0-0.1ubuntu1) ... Setting up rsyslog (8.32.0-1ubuntu4) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) debconf: falling back to frontend: Readline Creating config file /etc/rsyslog.d/50-default.conf with new version Adding user `syslog' to group `adm' ... Adding user syslog to group adm Done. dpkg: error processing package rsyslog (--configure): installed rsyslog package post-installation script subprocess returned error exit status 1 Processing triggers for systemd (237-3ubuntu10.43) ... Errors were encountered while processing: rsyslog E: Sub-process /usr/bin/dpkg returned an error code (1) root@ubuntu:/#

提示這些程式碼是因為系統中缺少 dialog-like 程式,一般出現在最小化安裝的ubuntu系統或者debian系統上。

我們可以使用安裝軟體的方法解決(sudo許可權):


apt-get install dialog 或 apt-get install whiptail

我們也可以修改debconf提示的方式,程式碼如下(sudo 許可權)

dpkg-reconfigure debconf

dpkg-reconfigure debconf 手動選noninteractive,級別選high

root@ubuntu:/# apt-get install rsyslog -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
rsyslog is already the newest version (8.32.0-1ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Setting up rsyslog (8.32.0-1ubuntu4) ...
The user `syslog' is already a member of `adm'.
dpkg: error processing package rsyslog (--configure):
 installed rsyslog package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 rsyslog
E: Sub-process /usr/bin/dpkg returned an error code (1)