Bug 1080949 - wrong date header with locale in alert mails
Summary: wrong date header with locale in alert mails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: smokeping
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Terje Røsten
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-26 10:49 UTC by Harald Reindl
Modified: 2014-04-05 04:52 UTC (History)
2 users (show)

Fixed In Version: smokeping-2.6.9-3.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-05 04:51:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harald Reindl 2014-03-26 10:49:35 UTC
Date: Di, 25 Mär 2014 08:42:40 +0100
results in thunderbird display 1970-01-01

any other tool like cron is producing date headers like this
Date: Tue, 25 Mar 2014 03:18:32 +0100 (CET)

apple mail is using this
Date: Fri, 14 Mar 2014 11:41:31 +0100

ms outlook is using this
Date: Mon, 17 Mar 2014 05:22:24 +0100

in other words: don't use the system locale for date-headers
and even don't use one at all likely results in postfix
adding one

Comment 1 Terje Røsten 2014-03-26 10:53:26 UTC
Thanks for your report.

Comment 2 Harald Reindl 2014-03-26 10:59:49 UTC
what may help without touch the code is explicit set the locale 
to POSIX in the systemd-unit, i will know in a short because 
currently one of our internet connections has packet loss

[Service]
Environment="LANG=C"

Comment 3 Fedora Update System 2014-03-26 19:48:25 UTC
smokeping-2.6.9-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/smokeping-2.6.9-3.fc19

Comment 4 Fedora Update System 2014-03-26 19:48:33 UTC
smokeping-2.6.9-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/smokeping-2.6.9-3.fc20

Comment 5 Harald Reindl 2014-03-26 19:55:58 UTC
impressive reaction, i would sell my soul for mor maintainers not feeling abused by reports!

i am about deploy the update with Environment="LANG=C" anyways since we are use some systemd features to restrict the daemon permissions which works not perfect in case of new targets but is do-able

[Unit]
Description=Smokeping
After=network.service systemd-networkd.service openvpn.service

[Service]
Type=simple
PermissionsStartOnly=true
Environment="LANG=C"
ExecStartPre=/usr/bin/chown -R nobody:apache /var/lib/smokeping/
ExecStart=/usr/sbin/smokeping --nodaemon
ExecReload=/usr/bin/kill -HUP $MAINPID
StandardError=syslog
Restart=always
RestartSec=1
Nice=19
IOSchedulingClass=3
PrivateTmp=true

CapabilityBoundingSet=CAP_CHOWN CAP_SETGID CAP_SETUID CAP_DAC_OVERRIDE CAP_KILL CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_CHROOT
ReadOnlyDirectories=/etc
ReadOnlyDirectories=/usr
InaccessibleDirectories=/boot
InaccessibleDirectories=/home
InaccessibleDirectories=/root
InaccessibleDirectories=/usr/local/scripts
InaccessibleDirectories=/var/lib/rpm
InaccessibleDirectories=/var/lib/yum
InaccessibleDirectories=/var/spool

User=nobody
Group=apache

[Install]
WantedBy=multi-user.target

Comment 6 Terje Røsten 2014-03-26 20:39:43 UTC
Thanks.

Where is $MAINPID coming from, systemd?

Are you using SELinux?

Would be nice to fix this one:
 https://bugzilla.redhat.com/show_bug.cgi?id=868893

Seen something similar?

Comment 7 Harald Reindl 2014-03-26 20:46:21 UTC
$MAINPID is coming from systemd - Type=simple

no idea in case of https://bugzilla.redhat.com/show_bug.cgi?id=868893
no SELinux here, the problem is normally smokeping is running as root

what i have achieved here is running as user:nobody and group:apache
_________________________________

this is a workaround and let the ExecStartPre run as root to fix permissions which works mostly but has some races in case of new targets like adde today, maybe a find-call for files/folders and set permissions would fix that fine in "ExecStartPre" but mostly only after minimum of one restart - i can live with that but not with have processes runnign as root all the time, however, not a big deal since it's working well enough and new targets no added every day - for inlcude it in the distribution that likely would need more cleanup

PermissionsStartOnly=true
ExecStartPre=/usr/bin/chown -R nobody:apache /var/lib/smokeping/

Comment 8 Terje Røsten 2014-03-26 20:49:53 UTC
Yeah, I understand your concern regarding, hope to get time to switch to unpriv user at some point.

Comment 9 Terje Røsten 2014-03-26 20:50:14 UTC
Yeah, I understand your concern regarding root, hope to get time to switch to unpriv user at some point.

Comment 10 Harald Reindl 2014-03-26 20:56:09 UTC
no problem, AFAIR i noticed that in a bugreport some time ago
but for people who really care it's do-able and it would
cause more harm if try to achieve that as default would break
new instalaltions of others, a nice long-term thing anyways

however, the output below may sehd some light about $MAINPID
in that case 27036 which is the perl process itself

[root@thx1138:~]$ systemctl status smokeping.service 
smokeping.service - Smokeping
   Loaded: loaded (/etc/systemd/system/smokeping.service; enabled)
   Active: active (running) since Mi 2014-03-26 20:53:56 CET; 1h 0min ago
  Process: 27032 ExecStartPre=/usr/bin/chown -R nobody:apache /var/lib/smokeping/ (code=exited, status=0/SUCCESS)
 Main PID: 27036 (perl)
   CGroup: name=systemd:/system/smokeping.service
           ├─ 7180 /usr/sbin/fping -C 41 -q -B1 -r1 -i10 **stripped**
           ├─27036 perl /usr/sbin/smokeping --nodaemon
           ├─27066 /usr/sbin/smokeping [FPing
           └─27067 /usr/sbin/smokeping [DNS

Comment 11 Harald Reindl 2014-03-27 15:00:34 UTC
BTW: confirmed with smokeping-2.6.9-3.fc19.noarch, given that the changelog says there is no longer a date-header added by smokeping my assumption postfix adds it anyways was correct

Subject: [SmokeAlert] packetloss_critical is active on DNS-Latency.ns1
Date: Thu, 27 Mar 2014 15:54:47 +0100 (CET)

Comment 12 Fedora Update System 2014-03-28 03:14:21 UTC
Package smokeping-2.6.9-3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing smokeping-2.6.9-3.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-4431/smokeping-2.6.9-3.fc19
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-04-05 04:51:28 UTC
smokeping-2.6.9-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2014-04-05 04:52:39 UTC
smokeping-2.6.9-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.