LPIC-1 GNU and Unix Commands • Complete Question Bank
Complete LPIC-1 GNU and Unix Commands question bank — all 0 questions with answers and detailed explanations.
You are a Linux administrator for a company that runs a web server on a system with limited disk space. The web server logs are stored in /var/log/httpd/access_log and grow quickly. The operations team requires that the most recent logs be available for troubleshooting, but logs older than 7 days must be compressed to save space. You decide to implement log rotation using logrotate. The logrotate configuration file for httpd currently contains:
/var/log/httpd/*.log { daily rotate 7 compress delaycompress missingok notifempty sharedscripts postrotate /bin/systemctl reload httpd 2>/dev/null || true endscript
}
After applying this configuration, you notice that log files are being compressed immediately instead of after one rotation. What is the most likely cause and the correct step to fix this?
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Halt
Single-user mode
Multi-user with networking
Multi-user with GUI
Reboot
Drag a concept onto its matching description — or click a concept then click the description.
First SCSI/SATA disk
First NVMe SSD
First serial port (COM1)
First loopback device
First software RAID device
-rwxr-xr-x 1 root root 12345 Jan 1 12:00 /usr/bin/myapp -rwsr-xr-x 1 root root 23456 Jan 1 12:00 /usr/bin/su -rw-rw-rw- 1 user1 user1 0 Jan 1 12:00 /tmp/shared
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 22564 4500 ? Ss Jan01 0:00 /sbin/init user1 1234 0.0 0.0 0 0 ? Z Jan01 0:00 [defunct] user1 1235 0.0 0.1 12345 2000 ? S Jan01 0:00 bash
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 10485760 9437184 1048576 90% / /dev/sdb1 20971520 20971520 0 100% /var
Refer to the exhibit. 30 4 1 * * /usr/bin/backup
0022
$ cat /etc/ssh/sshd_config | grep -i "PermitRootLogin" PermitRootLogin prohibit-password $ cat /etc/ssh/sshd_config | grep -i "PasswordAuthentication" PasswordAuthentication no
$ cat /etc/fstab /dev/sda1 /boot ext4 defaults 0 2 /dev/sda2 / ext4 defaults 0 1 /dev/sda3 none swap sw 0 0 /dev/sdb1 /data ext4 defaults 0 2 $ mount -o remount /data mount: /data: mount point not mounted or bad option.
$ cat /etc/at.allow root user1 $ cat /etc/at.deny user2 user3
$ ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 10 Dec 17 10:00 a1b2c3d4 -> ../../sda1 lrwxrwxrwx 1 root root 10 Dec 17 10:00 e5f6g7h8 -> ../../sda2 $ blkid /dev/sda1 /dev/sda1: UUID="a1b2c3d4" TYPE="ext4" $ blkid /dev/sda2 /dev/sda2: UUID="e5f6g7h8" TYPE="ext4" $ cat /etc/fstab UUID=a1b2c3d4 /boot ext4 defaults 0 2 UUID=e5f6g7h8 / ext4 defaults 0 1