Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

munin-asyncd doesn't start on Solaris #1616

Open
rorth opened this issue Apr 17, 2024 · 0 comments
Open

munin-asyncd doesn't start on Solaris #1616

rorth opened this issue Apr 17, 2024 · 0 comments

Comments

@rorth
Copy link

rorth commented Apr 17, 2024

Describe the bug
A clear and concise description of what the bug is.

When building/installing munin 2.0.73 on current Solaris 11.4, munin-asyncd wouldn't start.

To Reproduce
Steps to reproduce the behavior:

Start munin-asyncd as user munin.

Expected behavior
munin-asyncd should just start running.

Screenshots & Logs
Instead, it fails with

Cannot lock tied file '/var/opt/munin/spool/SPOOL-META' - Bad file number at /opt/munin/lib/perl5/Munin/Common/SyncDictFile.pm line 183.

Running it under truss (the Solaris syscall tracer), one sees

0339:  fcntl(6, F_SETLKW, 0xFFFFFFCC447A1BA8)          Err#9 EBADF
10339:          typ=F_WRLCK  whence=SEEK_SET start=0     len=0     sys=0  pid=1

According to the fcntl(2) manpage, the EBADF error happens under those condititions:

       EBADF

           The fildes argument is not a valid open file descriptor.

           The cmd argument is F_SETLK, F_SETLK64,  F_SETLKW,  or  F_SETLKW64,
           the type of lock, l_type, is a shared lock (F_RDLCK), and fildes is
           not  a  valid file descriptor open for reading; or the type of lock
           l_type is an exclusive lock (F_WRLCK) and fildes  is  not  a  valid
           file descriptor open for writing.

and indeed truss reveals that the file has been opened read-only:

10339:  openat(AT_FDCWD, "/var/opt/munin/spool/SPOOL-META", O_RDONLY|O_CLOEXEC) = 6

Desktop (please complete the following information):

  • Solaris 11.4 SRU 67
  • Munin 2.0.73

Additional context
I've managed to work around/fix the problem with the following patchlet to lib/perl5/Munin/Common/SyncDictFile.pm:

--- SyncDictFile.pm.dist        2024-04-03 16:31:18.000000000 +0200
+++ SyncDictFile.pm     2024-04-14 22:18:04.243103145 +0200
@@ -31,7 +31,7 @@
        
 
        use IO::File;
-       my $fh = _lock_write($self->{filename}, "r");
+       my $fh = _lock_write($self->{filename}, "w");
        my $fh_tmp = _lock_write($self->{filename} . ".tmp");
 
        # Read the whole file, writing it to $fh_tmp

It allowed munin-asyncd to start and it's collecting data for the configured plugins just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants