Bug 131812 - sysutils/nut: 2.4.0: upssched SEGVs on startup
Summary: sysutils/nut: 2.4.0: upssched SEGVs on startup
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Beat Gaetzi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-18 10:30 UTC by Roy Badami
Modified: 2009-02-20 17:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Badami 2009-02-18 10:30:03 UTC
In nut-2.4.0 installed from the sysutils/nut port, upssched appears to be non-functional (SEGV's when attempting to schedule an event.)

How-To-Repeat: Perform the following steps as root

1. Install nut-2.4.0 from ports.

2. Execute the following commands:
mkdir /var/db/nut/upssched
chown uucp:uucp /var/db/nut/upssched

3. If the upssched directory already existed, remove it's contents to avoid permissions or locking problems:
rm /var/db/nut/upssched/*

4. Create the file /usr/local/etc/nut/upssched.conf with the following contents:
======cut here==========
CMDSCRIPT /usr/bin/true
PIPEFN /var/db/nut/upssched/upssched.pipe
LOCKFN /var/db/nut/upssched/upssched.lock
AT ONBATT * START-TIMER mytimer 5
======cut here==========

5. Simulate upsched being called by upsmon by executing the command:
sh -c 'UPSNAME=test NOTIFYTYPE=ONBATT /usr/local/sbin/upssched "UPS on battery"'

6. Observe that upssched hangs for a while trying to start the daemon, and then SEGV's

7. Execute the command
tail /var/log/messages

8. Observe the log messages indicating that repeated attempts to fork the daemon resulted in SEGV.

9. Tidy up after ourselves:
rm /var/db/nut/upssched/*
Comment 1 Joerg Pulz 2009-02-19 12:18:27 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Dear Roy,

thanks for reporting this issue.
Can you verify that the procedure you mentioned in the PR works correct 
for nut-2.2.0 or earlier and is not working since your upgrade to 2.4.0?

Any additional informations are much appreciated.

Thanks a lot and kind regards
Joerg

- -- 
The beginning is the most important part of the work.
 				-Plato
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iD8DBQFJnU4WSPOsGF+KA+MRAkKgAJ9ADnJo7mFAIoYX8j1/M+39qdv5uACfXVOc
oL096UFSDU2Pq2zTAnfx2dU=
=pquq
-----END PGP SIGNATURE-----
Comment 2 Roy Badami 2009-02-19 12:51:17 UTC
    Joerg> thanks for reporting this issue.  Can you verify that the
    Joerg> procedure you mentioned in the PR works correct for
    Joerg> nut-2.2.0 or earlier and is not working since your upgrade
    Joerg> to 2.4.0?

I tested the above procedure on a 6.3-RELEASE-p3 machine running
nut-2.0.4 and it completed without error.  And on that machine I also
replaced the call to /usr/bin/true with a script that logs something
and verified that the script really did get run 5 seconds after
issuing the upssched command.

So I'm reasonably confident that the above test procedure is valid.

    -roy
Comment 3 Beat Gaetzi freebsd_committer freebsd_triage 2009-02-20 08:37:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->beat

I'll take it.
Comment 4 Beat Gaetzi freebsd_committer freebsd_triage 2009-02-20 17:53:51 UTC
State Changed
From-To: open->closed

Fixed by maintainer with ports/131885. Please update your portstree and 
update sysutils/nut. Thanks for reporting this problem!