[X2Go-Commits] [x2goserver] 01/02: x2goserver/sbin/x2gocleansessions: add Perl documentation and --help, -h, -? and --man options. Fixes: #1065.
git-admin at x2go.org
git-admin at x2go.org
Sun Aug 7 20:26:27 CEST 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.
commit 39e369dd08ba3e25263a51fdb230e7e88a13520b
Author: Mihai Moldovan <ionic at ionic.de>
Date: Sun Aug 7 20:06:53 2016 +0200
x2goserver/sbin/x2gocleansessions: add Perl documentation and --help, -h, -? and --man options. Fixes: #1065.
Also print a usage message on unknown options.
---
debian/changelog | 3 +++
x2goserver/sbin/x2gocleansessions | 51 +++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index c0635e1..a477aaa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -82,6 +82,9 @@ x2goserver (4.0.1.20-0x2go1) UNRELEASED; urgency=low
OpenSSH server versions seem to disable the Blowfish cipher by default,
leading to errors like "Connection reset by peer."
- x2goserver/bin/x2goruncommand: whitespace only.
+ - x2goserver/sbin/x2gocleansessions: add Perl documentation and --help,
+ -h, -? and --man options. Fixes: #1065. Also print a usage message on
+ unknown options.
* x2goserver.spec:
- Add sudo and logcheck as BuildRequires and Requires. Don't own
directories that are owned by sudo and logcheck. Logcheck is not
diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index 00cb43e..7428b66 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -30,6 +30,57 @@ use Capture::Tiny qw ( :all );
my $x2go_lib_path=`x2gopath libexec`;
use lib `x2gopath lib`;
use x2gologlevel;
+use Getopt::Long;
+use Pod::Usage;
+
+Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
+
+my $help = 0;
+my $man = 0;
+GetOptions('help|?|h' => \$help, 'man' => \$man) or pod2usage(2);
+pod2usage(1) if $help;
+pod2usage(-verbose => 2, -exitval => 0) if $man;
+
+__END__
+=head1 NAME
+
+x2gocleansessions - X2Go Server Cleanup Daemon
+
+=head1 SYNOPSIS
+
+x2gocleansessions [options]
+
+ Options:
+ --help|-h|-? brief help message
+ --man full documentation
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<--help>|B<-?>|B<-h>
+
+Print a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=back
+
+=head1 DESCRIPTION
+
+B<x2gocleansessions> is run as a service on X2Go servers to handle the cleanup
+of stale sessions.
+
+B<x2gocleansessions> must be run (as a service) with root privileges.
+
+=head1 AUTHOR
+
+This manual has been written by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
+for the X2Go project (http://www.x2go.org).
+
+=cut
openlog($0,'cons,pid','user');
setlogmask( LOG_UPTO(x2gologlevel()) );
--
Alioth's /srv/git/code.x2go.org/x2goserver.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list