Page 1 of 1

system backup fail to start

Posted: Tue Oct 06, 2020 10:43 pm
by mansonli
Is the system backup unable to start (see screenshot attached) due to expired password of nna which's used to run cron job? If yes, how to change its password and ensure NNA service can be running normally?

● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-09-17 18:33:09 HKT; 2 weeks 5 days ago
Main PID: 683 (crond)
Memory: 768.0K
CGroup: /system.slice/crond.service
└─683 /usr/sbin/crond -n

Oct 07 11:26:01 AZALVGISNGOAP11 crond[12727]: pam_unix(crond:account): expired password for user nna (password aged)
Oct 07 11:26:01 AZALVGISNGOAP11 crond[12727]: (nna) PAM ERROR (Authentication token is no longer valid; new one required)
Oct 07 11:27:01 AZALVGISNGOAP11 crond[12948]: pam_unix(crond:account): expired password for user nna (password aged)
Oct 07 11:27:01 AZALVGISNGOAP11 crond[12948]: (nna) PAM ERROR (Authentication token is no longer valid; new one required)
Oct 07 11:28:01 AZALVGISNGOAP11 crond[13129]: pam_unix(crond:account): expired password for user nna (password aged)
Oct 07 11:28:01 AZALVGISNGOAP11 crond[13129]: (nna) PAM ERROR (Authentication token is no longer valid; new one required)
Oct 07 11:29:01 AZALVGISNGOAP11 crond[13308]: pam_unix(crond:account): expired password for user nna (password aged)
Oct 07 11:29:01 AZALVGISNGOAP11 crond[13308]: (nna) PAM ERROR (Authentication token is no longer valid; new one required)
Oct 07 11:30:01 AZALVGISNGOAP11 crond[13548]: pam_unix(crond:account): expired password for user nna (password aged)
Oct 07 11:30:01 AZALVGISNGOAP11 crond[13548]: (nna) PAM ERROR (Authentication token is no longer valid; new one required)

Re: system backup fail to start

Posted: Wed Oct 07, 2020 2:02 pm
by tgriep
Login as root to the NNA serevr and run the following to remove the password and set it to not expire.

Code: Select all

passwd --delete nna
chage -I -1 -m 0 -M 99999 -E -1 nna
The next time the cron job runs, it should be able to run what is needed as the nna user.

Re: system backup fail to start

Posted: Thu Oct 08, 2020 12:56 am
by mansonli
However, user naa doesn't exist in /etc/passwd. Why there's error when running cron job as this user? As such, how to fix backup error?

Re: system backup fail to start

Posted: Thu Oct 08, 2020 8:39 am
by tgriep
The error is for the nna user, not for a user called naa.

Re: system backup fail to start

Posted: Mon Oct 12, 2020 4:58 am
by mansonli
If nna's password is removed, will this impact service run as this user not able to run normally?

Re: system backup fail to start

Posted: Mon Oct 12, 2020 8:42 am
by tgriep
Yes, removing the password will fix the cron job that is failing and allow it to run.

Re: system backup fail to start

Posted: Wed Oct 14, 2020 4:52 am
by mansonli
Where's the system backup stored? Is it possible to change its default path?

Re: system backup fail to start

Posted: Wed Oct 14, 2020 9:06 am
by tgriep
The backups are stored in /store/backups/nagiosna by default.

To change the path where the backups are stored, you would have to edit this script.

Code: Select all

/usr/local/nagiosna/scripts/backup_na.sh
Change the rootdir option to the path you want.

Code: Select all

if [ -z $rootdir ]; then
    rootdir="/store/backups/nagiosna"
fi
The path you use has to be writable by the nna user and the nnacmd group.

You will also have to edit this file

Code: Select all

/var/www/html/nagiosna/application/controllers/admin.php
and change the path /store/backups/nagiosna to the new location so the Web interface will look there for the backup files and display them in the GUI.

Re: system backup fail to start

Posted: Tue Oct 20, 2020 11:11 pm
by mansonli
which proceeses and services does nna use for? Will password removal of this user cause service outage or interruption?

Re: system backup fail to start

Posted: Wed Oct 21, 2020 4:48 pm
by tgriep
Cron jobs, the nfcapd daemon that captures the data use the nna account to run and removing the password will not cause service outage or interruptions.