SG-3100 - Status logs for php-fpm show date in UTC instead of selected timezone
-
I've been paying more attention to my logs recently and noticed that when I log in, the System/General logs for php-fpm display a different time than the other events. It appears that it's displaying the UTC time instead of the timezone I've selected in General Setup and is displaying for other logged events. Any idea how to fix this?
I'm running on an SG-3100, version 23.01-RELEASE.
Here's some output from the logs:
Mar 13 07:35:00 sshguard 54256 Now monitoring attacks. Mar 13 08:02:00 sshguard 54256 Exiting on signal. Mar 13 08:02:00 sshguard 54371 Now monitoring attacks. Mar 13 12:20:23 php-fpm 15782 /services_dhcp.php: Successful login for user 'redacted' from: redacted (Local Database) Mar 13 08:28:00 sshguard 54371 Exiting on signal. Mar 13 08:28:00 sshguard 60954 Now monitoring attacks. Mar 13 08:52:00 sshguard 60954 Exiting on signal. Mar 13 08:52:00 sshguard 1732 Now monitoring attacks. Mar 13 09:17:00 sshguard 1732 Exiting on signal. Mar 13 09:17:00 sshguard 92627 Now monitoring attacks. Mar 13 09:42:00 sshguard 92627 Exiting on signal. Mar 13 09:42:00 sshguard 47491 Now monitoring attacks. Mar 13 10:09:00 sshguard 47491 Exiting on signal. Mar 13 10:09:00 sshguard 6846 Now monitoring attacks. Mar 13 10:35:00 sshguard 6846 Exiting on signal. Mar 13 10:35:00 sshguard 51211 Now monitoring attacks. Mar 13 11:01:00 sshguard 51211 Exiting on signal. Mar 13 11:01:00 sshguard 15071 Now monitoring attacks. Mar 13 11:27:00 sshguard 15071 Exiting on signal. Mar 13 11:27:00 sshguard 65406 Now monitoring attacks. Mar 13 11:53:00 sshguard 65406 Exiting on signal. Mar 13 11:53:00 sshguard 55908 Now monitoring attacks. Mar 13 16:05:50 php-fpm 15782 /index.php: Successful login for user 'redacted' from: redacted (Local Database)
Here's the time after noticing the logs:
Shell Output - date Mon Mar 13 12:08:31 EDT 2023 Shell Output - date -u Mon Mar 13 16:08:46 UTC 2023
-
@dchiang1987 I've seen that before somewhere/sometime also. Does it persist after a restart? Or maybe just restart PHP at the console menu? Sometimes daemons don't pick up time zone changes until they restart.
-
@steveits good call! I just restarted php-fpm via putty and that fixed things. I'll keep that in mind in the future.
Mar 13 14:28:00 sshguard 14600 Now monitoring attacks. Mar 13 14:52:00 sshguard 14600 Exiting on signal. Mar 13 14:52:00 sshguard 64545 Now monitoring attacks. Mar 13 14:55:02 sshd 6145 Accepted keyboard-interactive/pam for redacted from redacted port 62482 ssh2 Mar 13 15:09:13 rc.php-fpm_restart 2292 >>> Restarting php-fpm Mar 13 15:09:13 check_reload_status 3473 check_reload_status is starting. Mar 13 15:09:36 php-fpm 3013 /index.php: User logged out for user 'redacted' from: redacted (Local Database) Mar 13 15:09:50 php-fpm 2514 /index.php: Successful login for user 'redacted' from: redacted (Local Database)