Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-08-02 Thread Andrew J. Hesford
Looks like this was just released from some review queue. I resubmitted
this patch in June and it was already merged, so please disregard this.

Sorry for the noise!

On 2021-05-11 at 19:53 (UTC -0400), Andrew J. Hesford wrote:
> Greetings,
> 
> Following is a pull request against the 4.1.0.x branch that separates
> the no-fork behavior of x2gocleansessions from the debug output
> behavior. A new flag, `--nofork` (`-n-` for short) determined whether
> the program forks; `--debug` only controls the logging verbosity and
> also forces `$nofork=1` to preserve old behavior.
> 
> Please let me know if anything should be changed.
> 
> Thanks,
> Andrew Hesford
> 
> The following changes since commit cabad60865be64de219b3b477ddaefa6aef1cf43:
> 
>   Continue development (2018-11-29 08:09:45 +0100)
> 
> are available in the Git repository at:
> 
>   https://github.com/ahesford/x2goserver.git nofork
> 
> for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:
> 
>   Separate non-forking behavior from --debug into --nofork (2021-05-11 
> 19:27:02 -0400)
> 
> 
> Andrew J. Hesford (1):
>   Separate non-forking behavior from --debug into --nofork
> 
>  x2goserver/sbin/x2gocleansessions | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/x2goserver/sbin/x2gocleansessions 
> b/x2goserver/sbin/x2gocleansessions
> index e78f677a..8e2ba433 100755
> --- a/x2goserver/sbin/x2gocleansessions
> +++ b/x2goserver/sbin/x2gocleansessions
> @@ -40,15 +40,17 @@ use Pod::Usage;
>  Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
>  
>  my $debug = 0;
> +my $nofork = 0;
>  my $help = 0;
>  my $man = 0;
> -GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man) or 
> pod2usage(2);
> +GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' => 
> \$help, 'man' => \$man) or pod2usage(2);
>  pod2usage(1) if $help;
>  pod2usage(-verbose => 2, -exitval => 0) if $man;
>  
>  openlog($0,'cons,pid','user');
>  if ($debug)
>  {
> + $nofork = 1;
>   setlogmask( LOG_UPTO (LOG_DEBUG) );
>  }
>  else
> @@ -99,12 +101,12 @@ my $uname;
>  my $serv = hostname;
>  my $pid;
>  
> -if (! $debug)
> +if (! $nofork)
>  {
>   $pid = fork();
>  }
>  
> -if ((!$debug) && (not defined $pid))
> +if ((!$nofork) && (not defined $pid))
>  {
>   print "resources not avilable.\n";
>  }
> @@ -128,7 +130,7 @@ elsif ($pid == 0 )
>   my $superenice_idle=$Config->param("superenicer.idle-nice-level");
>   my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");
>  
> - if ( ! $debug )
> + if ( ! $nofork )
>   {
>   # close any open file descriptor left open by our parent before 
> the fork
>   my $fd;
> @@ -377,7 +379,8 @@ x2gocleansessions [options]
>Options:
>  --help|-h|-?brief help message
>  --man   full documentation
> ---debug|-d  enable debugging and don't daemonize
> +--debug|-d  enable debugging; implies --nofork
> +--nofork|-n don't daemonize
>  
>  =head1 OPTIONS
>  
> @@ -393,8 +396,11 @@ Prints the manual page and exits.
>  
>  =item B<--debug>|B<-d>
>  
> -Override debugging setting in global config and keep application in 
> foreground
> -instead of daemonizing.
> +Override debugging setting in global config; implies B<--nofork>.
> +
> +=item B<--nofork>|B<-n>
> +
> +Keep application in foreground instead of daemonizing.
>  
>  =back
> ___
> x2go-dev mailing list
> x2go-dev@lists.x2go.org
> https://lists.x2go.org/listinfo/x2go-dev
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


[X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-08-01 Thread Andrew J. Hesford
Greetings,

Following is a pull request against the 4.1.0.x branch that separates
the no-fork behavior of x2gocleansessions from the debug output
behavior. A new flag, `--nofork` (`-n-` for short) determined whether
the program forks; `--debug` only controls the logging verbosity and
also forces `$nofork=1` to preserve old behavior.

Please let me know if anything should be changed.

Thanks,
Andrew Hesford

The following changes since commit cabad60865be64de219b3b477ddaefa6aef1cf43:

  Continue development (2018-11-29 08:09:45 +0100)

are available in the Git repository at:

  https://github.com/ahesford/x2goserver.git nofork

for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:

  Separate non-forking behavior from --debug into --nofork (2021-05-11 19:27:02 
-0400)


Andrew J. Hesford (1):
  Separate non-forking behavior from --debug into --nofork

 x2goserver/sbin/x2gocleansessions | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/x2goserver/sbin/x2gocleansessions 
b/x2goserver/sbin/x2gocleansessions
index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -40,15 +40,17 @@ use Pod::Usage;
 Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
 
 my $debug = 0;
+my $nofork = 0;
 my $help = 0;
 my $man = 0;
-GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man) or 
pod2usage(2);
+GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' => \$help, 
'man' => \$man) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage(-verbose => 2, -exitval => 0) if $man;
 
 openlog($0,'cons,pid','user');
 if ($debug)
 {
+   $nofork = 1;
setlogmask( LOG_UPTO (LOG_DEBUG) );
 }
 else
@@ -99,12 +101,12 @@ my $uname;
 my $serv = hostname;
 my $pid;
 
-if (! $debug)
+if (! $nofork)
 {
$pid = fork();
 }
 
-if ((!$debug) && (not defined $pid))
+if ((!$nofork) && (not defined $pid))
 {
print "resources not avilable.\n";
 }
@@ -128,7 +130,7 @@ elsif ($pid == 0 )
my $superenice_idle=$Config->param("superenicer.idle-nice-level");
my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");
 
-   if ( ! $debug )
+   if ( ! $nofork )
{
# close any open file descriptor left open by our parent before 
the fork
my $fd;
@@ -377,7 +379,8 @@ x2gocleansessions [options]
   Options:
 --help|-h|-?brief help message
 --man   full documentation
---debug|-d  enable debugging and don't daemonize
+--debug|-d  enable debugging; implies --nofork
+--nofork|-n don't daemonize
 
 =head1 OPTIONS
 
@@ -393,8 +396,11 @@ Prints the manual page and exits.
 
 =item B<--debug>|B<-d>
 
-Override debugging setting in global config and keep application in foreground
-instead of daemonizing.
+Override debugging setting in global config; implies B<--nofork>.
+
+=item B<--nofork>|B<-n>
+
+Keep application in foreground instead of daemonizing.
 
 =back
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-27 Thread Mike Gabriel

Hi Andrew, hi Paul,

On  Sa 26 Jun 2021 22:15:01 CEST, Andrew J. Hesford wrote:


On 2021-06-26 at 01:44 (UTC -0400), Mike Gabriel wrote:
HI Andrew,


On  Do 24 Jun 2021 16:13:06 CEST, Andrew J. Hesford wrote:


Greetings,

Following is a pull request against the 4.1.0.x branch that separates
the no-fork behavior of x2gocleansessions from the debug output
behavior. A new flag, `--nofork` (`-n-` for short) determined whether
the program forks; `--debug` only controls the logging verbosity and
also forces `$nofork=1` to preserve old behavior.

Please let me know if anything should be changed.

Thanks,
Andrew Hesford

The following changes since commit  
cabad60865be64de219b3b477ddaefa6aef1cf43:


  Continue development (2018-11-29 08:09:45 +0100)

are available in the Git repository at:

  https://github.com/ahesford/x2goserver.git nofork

for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:

  Separate non-forking behavior from --debug into --nofork (2021-05-11
19:27:02 -0400)


Andrew J. Hesford (1):
  Separate non-forking behavior from --debug into --nofork

 x2goserver/sbin/x2gocleansessions | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/x2goserver/sbin/x2gocleansessions
b/x2goserver/sbin/x2gocleansessions
index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -40,15 +40,17 @@ use Pod::Usage;
 Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");

 my $debug = 0;
+my $nofork = 0;
 my $help = 0;
 my $man = 0;
-GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man)
or pod2usage(2);
+GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' =>
\$help, 'man' => \$man) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage(-verbose => 2, -exitval => 0) if $man;

 openlog($0,'cons,pid','user');
 if ($debug)
 {
+   $nofork = 1;
setlogmask( LOG_UPTO (LOG_DEBUG) );
 }
 else
@@ -99,12 +101,12 @@ my $uname;
 my $serv = hostname;
 my $pid;

-if (! $debug)
+if (! $nofork)
 {
$pid = fork();
 }

-if ((!$debug) && (not defined $pid))
+if ((!$nofork) && (not defined $pid))
 {
print "resources not avilable.\n";
 }
@@ -128,7 +130,7 @@ elsif ($pid == 0 )
my $superenice_idle=$Config->param("superenicer.idle-nice-level");
my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");

-   if ( ! $debug )
+   if ( ! $nofork )
{
# close any open file descriptor left open by our parent before

the fork

my $fd;
@@ -377,7 +379,8 @@ x2gocleansessions [options]
   Options:
 --help|-h|-?brief help message
 --man   full documentation
---debug|-d  enable debugging and don't daemonize
+--debug|-d  enable debugging; implies --nofork
+--nofork|-n don't daemonize

 =head1 OPTIONS

@@ -393,8 +396,11 @@ Prints the manual page and exits.

 =item B<--debug>|B<-d>

-Override debugging setting in global config and keep application in
foreground
-instead of daemonizing.
+Override debugging setting in global config; implies B<--nofork>.
+
+=item B<--nofork>|B<-n>
+
+Keep application in foreground instead of daemonizing.

 =back



the patch looks good. Can you resend the patch as an attachment? It go
re-formated here and does not apply cleanly with "git am".

Make sure to Cc: me directly, so that I don't miss your reply.

Thanks,
Mike




Mike,

Not a problem. A patch against release/4.1.0.x is attached. Please let
me know if you need anything else.

Thanks,
Andrew


Your patch has been applied:
https://code.x2go.org/gitweb?p=x2goserver.git;a=commit;h=443435f175ea078dabe481c5b5d883550d1e8e2e

And yes, I agree with Paul, please, next time use git format-patch.

Thanks,
Mike

--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpmOSbYAG0Pz.pgp
Description: Digitale PGP-Signatur
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-26 Thread Andrew J. Hesford
Paul,

Thanks for your comments. I spend too much time with GitHub, so some of
Git's patch manipulation tools are not second nature. :) The attached
patch includes a more descriptive commit message and was produced with
git-format-patch.

Cheers,
Andrew

On 2021-06-26 at 16:58 (UTC -0400), Paul Menzel wrote:
> Dear Andrew,
> 
> Am 26.06.21 um 22:15 schrieb Andrew J. Hesford:
> 
> > Not a problem. A patch against release/4.1.0.x is attached. Please let
> > me know if you need anything else.
> 
> As the commit message summary is intended, did you copy it from `git show`?
> `git format-patch -1` (and even `git send-email …`) might be better.
> 
> Also, you could add your original message as commit message body.
> 
> > Following is a pull request against the 4.1.0.x branch that separates
> > the no-fork behavior of x2gocleansessions from the debug output
> > behavior. A new flag, `--nofork` (`-n-` for short) determined whether
> > the program forks; `--debug` only controls the logging verbosity and
> > also forces `$nofork=1` to preserve old behavior.
> 
> s/determined/determines/
> 
> 
> Kind regards,
> 
> Paul

-- 
Andrew J. Hesford
a...@sideband.org
(Personal communication)
>From e7aaa80526b4a181ab08630cc37fbc2e6e1812ed Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" 
Date: Tue, 11 May 2021 19:26:29 -0400
Subject: [PATCH] x2gocleansessions: add --nofork argument to prevent forking

A new `--nofork` flag (`-n` for short) determines whether the program
forks; the existing `--debug` remains to control logging verbosity and
implies `--nofork` to preserve old behavior. The new flag allows
service managers to keep x2gocleansessions in the foreground without
also requiring verbose debugging output.
---
 x2goserver/sbin/x2gocleansessions | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -40,15 +40,17 @@ use Pod::Usage;
 Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
 
 my $debug = 0;
+my $nofork = 0;
 my $help = 0;
 my $man = 0;
-GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man) or pod2usage(2);
+GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' => \$help, 'man' => \$man) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage(-verbose => 2, -exitval => 0) if $man;
 
 openlog($0,'cons,pid','user');
 if ($debug)
 {
+	$nofork = 1;
 	setlogmask( LOG_UPTO (LOG_DEBUG) );
 }
 else
@@ -99,12 +101,12 @@ my $uname;
 my $serv = hostname;
 my $pid;
 
-if (! $debug)
+if (! $nofork)
 {
 	$pid = fork();
 }
 
-if ((!$debug) && (not defined $pid))
+if ((!$nofork) && (not defined $pid))
 {
 	print "resources not avilable.\n";
 }
@@ -128,7 +130,7 @@ elsif ($pid == 0 )
 	my $superenice_idle=$Config->param("superenicer.idle-nice-level");
 	my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");
 
-	if ( ! $debug )
+	if ( ! $nofork )
 	{
 		# close any open file descriptor left open by our parent before the fork
 		my $fd;
@@ -377,7 +379,8 @@ x2gocleansessions [options]
   Options:
 --help|-h|-?brief help message
 --man   full documentation
---debug|-d  enable debugging and don't daemonize
+--debug|-d  enable debugging; implies --nofork
+--nofork|-n don't daemonize
 
 =head1 OPTIONS
 
@@ -393,8 +396,11 @@ Prints the manual page and exits.
 
 =item B<--debug>|B<-d>
 
-Override debugging setting in global config and keep application in foreground
-instead of daemonizing.
+Override debugging setting in global config; implies B<--nofork>.
+
+=item B<--nofork>|B<-n>
+
+Keep application in foreground instead of daemonizing.
 
 =back
 
-- 
2.32.0

___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-26 Thread Paul Menzel

Dear Andrew,


Am 26.06.21 um 22:15 schrieb Andrew J. Hesford:


Not a problem. A patch against release/4.1.0.x is attached. Please let
me know if you need anything else.


As the commit message summary is intended, did you copy it from `git 
show`? `git format-patch -1` (and even `git send-email …`) might be better.


Also, you could add your original message as commit message body.


Following is a pull request against the 4.1.0.x branch that separates
the no-fork behavior of x2gocleansessions from the debug output
behavior. A new flag, `--nofork` (`-n-` for short) determined whether
the program forks; `--debug` only controls the logging verbosity and
also forces `$nofork=1` to preserve old behavior.


s/determined/determines/


Kind regards,

Paul
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-26 Thread Andrew J. Hesford
Mike,

Not a problem. A patch against release/4.1.0.x is attached. Please let
me know if you need anything else.

Thanks,
Andrew

On 2021-06-26 at 01:44 (UTC -0400), Mike Gabriel wrote:
> HI Andrew,
> 
> the patch looks good. Can you resend the patch as an attachment? It go
> re-formated here and does not apply cleanly with "git am".
> 
> Make sure to Cc: me directly, so that I don't miss your reply.
> 
> Thanks,
> Mike
> 
> On  Do 24 Jun 2021 16:13:06 CEST, Andrew J. Hesford wrote:
> 
> > Greetings,
> > 
> > Following is a pull request against the 4.1.0.x branch that separates
> > the no-fork behavior of x2gocleansessions from the debug output
> > behavior. A new flag, `--nofork` (`-n-` for short) determined whether
> > the program forks; `--debug` only controls the logging verbosity and
> > also forces `$nofork=1` to preserve old behavior.
> > 
> > Please let me know if anything should be changed.
> > 
> > Thanks,
> > Andrew Hesford
> > 
> > The following changes since commit cabad60865be64de219b3b477ddaefa6aef1cf43:
> > 
> >   Continue development (2018-11-29 08:09:45 +0100)
> > 
> > are available in the Git repository at:
> > 
> >   https://github.com/ahesford/x2goserver.git nofork
> > 
> > for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:
> > 
> >   Separate non-forking behavior from --debug into --nofork (2021-05-11
> > 19:27:02 -0400)
> > 
> > 
> > Andrew J. Hesford (1):
> >   Separate non-forking behavior from --debug into --nofork
> > 
> >  x2goserver/sbin/x2gocleansessions | 20 +---
> >  1 file changed, 13 insertions(+), 7 deletions(-)
> > 
> > diff --git a/x2goserver/sbin/x2gocleansessions
> > b/x2goserver/sbin/x2gocleansessions
> > index e78f677a..8e2ba433 100755
> > --- a/x2goserver/sbin/x2gocleansessions
> > +++ b/x2goserver/sbin/x2gocleansessions
> > @@ -40,15 +40,17 @@ use Pod::Usage;
> >  Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
> > 
> >  my $debug = 0;
> > +my $nofork = 0;
> >  my $help = 0;
> >  my $man = 0;
> > -GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man)
> > or pod2usage(2);
> > +GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' =>
> > \$help, 'man' => \$man) or pod2usage(2);
> >  pod2usage(1) if $help;
> >  pod2usage(-verbose => 2, -exitval => 0) if $man;
> > 
> >  openlog($0,'cons,pid','user');
> >  if ($debug)
> >  {
> > +   $nofork = 1;
> > setlogmask( LOG_UPTO (LOG_DEBUG) );
> >  }
> >  else
> > @@ -99,12 +101,12 @@ my $uname;
> >  my $serv = hostname;
> >  my $pid;
> > 
> > -if (! $debug)
> > +if (! $nofork)
> >  {
> > $pid = fork();
> >  }
> > 
> > -if ((!$debug) && (not defined $pid))
> > +if ((!$nofork) && (not defined $pid))
> >  {
> > print "resources not avilable.\n";
> >  }
> > @@ -128,7 +130,7 @@ elsif ($pid == 0 )
> > my $superenice_idle=$Config->param("superenicer.idle-nice-level");
> > my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");
> > 
> > -   if ( ! $debug )
> > +   if ( ! $nofork )
> > {
> > # close any open file descriptor left open by our parent before 
> > the fork
> > my $fd;
> > @@ -377,7 +379,8 @@ x2gocleansessions [options]
> >Options:
> >  --help|-h|-?brief help message
> >  --man   full documentation
> > ---debug|-d  enable debugging and don't daemonize
> > +--debug|-d  enable debugging; implies --nofork
> > +--nofork|-n don't daemonize
> > 
> >  =head1 OPTIONS
> > 
> > @@ -393,8 +396,11 @@ Prints the manual page and exits.
> > 
> >  =item B<--debug>|B<-d>
> > 
> > -Override debugging setting in global config and keep application in
> > foreground
> > -instead of daemonizing.
> > +Override debugging setting in global config; implies B<--nofork>.
> > +
> > +=item B<--nofork>|B<-n>
> > +
> > +Keep application in foreground instead of daemonizing.
> > 
> >  =back
> > ___
> > x2go-dev mailing list
> > x2go-dev@lists.x2go.org
> > https://lists.x2go.org/listinfo/x2go-dev
> 
> 
> -- 
> 
> DAS-NETZWERKTEAM
> c\o Technik- und Ökologiezentrum Eckernförde
> Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
> mobile: +49 (1520) 1976 148
> landline: +49 (4351) 850 8940
> 
> GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
> mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de
> 



-- 
Andrew J. Hesford
a...@sideband.org
(Personal communication)

(585) 203-4284
https://www.linkedin.com/in/ajhesford
commit 4587d918c138205c252316c007fab31b75b87061
Author: Andrew J. Hesford 
Date:   Tue May 11 19:26:29 2021 -0400

Separate non-forking behavior from --debug into --nofork

diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions
index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions

Re: [X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-26 Thread Mike Gabriel

HI Andrew,

the patch looks good. Can you resend the patch as an attachment? It go  
re-formated here and does not apply cleanly with "git am".


Make sure to Cc: me directly, so that I don't miss your reply.

Thanks,
Mike

On  Do 24 Jun 2021 16:13:06 CEST, Andrew J. Hesford wrote:


Greetings,

Following is a pull request against the 4.1.0.x branch that separates
the no-fork behavior of x2gocleansessions from the debug output
behavior. A new flag, `--nofork` (`-n-` for short) determined whether
the program forks; `--debug` only controls the logging verbosity and
also forces `$nofork=1` to preserve old behavior.

Please let me know if anything should be changed.

Thanks,
Andrew Hesford

The following changes since commit cabad60865be64de219b3b477ddaefa6aef1cf43:

  Continue development (2018-11-29 08:09:45 +0100)

are available in the Git repository at:

  https://github.com/ahesford/x2goserver.git nofork

for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:

  Separate non-forking behavior from --debug into --nofork  
(2021-05-11 19:27:02 -0400)



Andrew J. Hesford (1):
  Separate non-forking behavior from --debug into --nofork

 x2goserver/sbin/x2gocleansessions | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/x2goserver/sbin/x2gocleansessions  
b/x2goserver/sbin/x2gocleansessions

index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -40,15 +40,17 @@ use Pod::Usage;
 Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");

 my $debug = 0;
+my $nofork = 0;
 my $help = 0;
 my $man = 0;
-GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' =>  
\$man) or pod2usage(2);
+GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h'  
=> \$help, 'man' => \$man) or pod2usage(2);

 pod2usage(1) if $help;
 pod2usage(-verbose => 2, -exitval => 0) if $man;

 openlog($0,'cons,pid','user');
 if ($debug)
 {
+   $nofork = 1;
setlogmask( LOG_UPTO (LOG_DEBUG) );
 }
 else
@@ -99,12 +101,12 @@ my $uname;
 my $serv = hostname;
 my $pid;

-if (! $debug)
+if (! $nofork)
 {
$pid = fork();
 }

-if ((!$debug) && (not defined $pid))
+if ((!$nofork) && (not defined $pid))
 {
print "resources not avilable.\n";
 }
@@ -128,7 +130,7 @@ elsif ($pid == 0 )
my $superenice_idle=$Config->param("superenicer.idle-nice-level");
my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");

-   if ( ! $debug )
+   if ( ! $nofork )
{
# close any open file descriptor left open by our parent before 
the fork
my $fd;
@@ -377,7 +379,8 @@ x2gocleansessions [options]
   Options:
 --help|-h|-?brief help message
 --man   full documentation
---debug|-d  enable debugging and don't daemonize
+--debug|-d  enable debugging; implies --nofork
+--nofork|-n don't daemonize

 =head1 OPTIONS

@@ -393,8 +396,11 @@ Prints the manual page and exits.

 =item B<--debug>|B<-d>

-Override debugging setting in global config and keep application in  
foreground

-instead of daemonizing.
+Override debugging setting in global config; implies B<--nofork>.
+
+=item B<--nofork>|B<-n>
+
+Keep application in foreground instead of daemonizing.

 =back
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev



--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpX9P1Ob7blG.pgp
Description: Digitale PGP-Signatur
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev


[X2Go-Dev] Pull request: add --nofork option to x2gocleansessions

2021-06-24 Thread Andrew J. Hesford
Greetings,

Following is a pull request against the 4.1.0.x branch that separates
the no-fork behavior of x2gocleansessions from the debug output
behavior. A new flag, `--nofork` (`-n-` for short) determined whether
the program forks; `--debug` only controls the logging verbosity and
also forces `$nofork=1` to preserve old behavior.

Please let me know if anything should be changed.

Thanks,
Andrew Hesford

The following changes since commit cabad60865be64de219b3b477ddaefa6aef1cf43:

  Continue development (2018-11-29 08:09:45 +0100)

are available in the Git repository at:

  https://github.com/ahesford/x2goserver.git nofork

for you to fetch changes up to 4587d918c138205c252316c007fab31b75b87061:

  Separate non-forking behavior from --debug into --nofork (2021-05-11 19:27:02 
-0400)


Andrew J. Hesford (1):
  Separate non-forking behavior from --debug into --nofork

 x2goserver/sbin/x2gocleansessions | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/x2goserver/sbin/x2gocleansessions 
b/x2goserver/sbin/x2gocleansessions
index e78f677a..8e2ba433 100755
--- a/x2goserver/sbin/x2gocleansessions
+++ b/x2goserver/sbin/x2gocleansessions
@@ -40,15 +40,17 @@ use Pod::Usage;
 Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
 
 my $debug = 0;
+my $nofork = 0;
 my $help = 0;
 my $man = 0;
-GetOptions('debug|d' => \$debug, 'help|?|h' => \$help, 'man' => \$man) or 
pod2usage(2);
+GetOptions('debug|d' => \$debug, 'nofork|n' => \$nofork, 'help|?|h' => \$help, 
'man' => \$man) or pod2usage(2);
 pod2usage(1) if $help;
 pod2usage(-verbose => 2, -exitval => 0) if $man;
 
 openlog($0,'cons,pid','user');
 if ($debug)
 {
+   $nofork = 1;
setlogmask( LOG_UPTO (LOG_DEBUG) );
 }
 else
@@ -99,12 +101,12 @@ my $uname;
 my $serv = hostname;
 my $pid;
 
-if (! $debug)
+if (! $nofork)
 {
$pid = fork();
 }
 
-if ((!$debug) && (not defined $pid))
+if ((!$nofork) && (not defined $pid))
 {
print "resources not avilable.\n";
 }
@@ -128,7 +130,7 @@ elsif ($pid == 0 )
my $superenice_idle=$Config->param("superenicer.idle-nice-level");
my $superenice_ignoredusers=$Config->param("superenicer.ignored-users");
 
-   if ( ! $debug )
+   if ( ! $nofork )
{
# close any open file descriptor left open by our parent before 
the fork
my $fd;
@@ -377,7 +379,8 @@ x2gocleansessions [options]
   Options:
 --help|-h|-?brief help message
 --man   full documentation
---debug|-d  enable debugging and don't daemonize
+--debug|-d  enable debugging; implies --nofork
+--nofork|-n don't daemonize
 
 =head1 OPTIONS
 
@@ -393,8 +396,11 @@ Prints the manual page and exits.
 
 =item B<--debug>|B<-d>
 
-Override debugging setting in global config and keep application in foreground
-instead of daemonizing.
+Override debugging setting in global config; implies B<--nofork>.
+
+=item B<--nofork>|B<-n>
+
+Keep application in foreground instead of daemonizing.
 
 =back
___
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev