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

Fixes for systemd unit #32

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fixes for systemd unit #32

wants to merge 5 commits into from

Conversation

seriv
Copy link

@seriv seriv commented Nov 16, 2015

Typo fixed, thanks to @yakatz. Fixed excessive restarting of the unit and provided PIDFile for systemd.

yakatz and others added 3 commits November 16, 2015 16:46
Added option -r <pidfile> for resmon.
If none provided it will run without creating pidfile.
If provided, it will try write it's pid into specified file.
Resmon-systemd.service should have this file as an argument for
resmon as a PIDFile option and in ExecStart option.
resmon Outdated
close PIDFILE or die "can't close $PIDFILE";
}
exit;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could fix style (spaces around operators and commas) if that matters.

Not sure about convention here, but maybe lowercase the $PIDFILE var so it doesn't look like the file handle PIDFILE, or just keep using $config->{pidfile}.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the three-arg form of open(), instead of the two-arg form with string interpolation, and scalar filehandles instead of barewords:

open(my $pidfh, '>', $config->{pidfile}) or die "can't open $config->{pidfile}";

@seriv
Copy link
Author

seriv commented Nov 18, 2015

Thanks, updated pull request.

'==' can not compare file handles. We can use fileno() function to
compare numerically file numbers. Code without this returns
"connection successful" when it timeouts and $fd is "undefined".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants