Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
64b8ac17
Commit
64b8ac17
authored
Jun 18, 2014
by
Robert Ricci
Browse files
Redirect STDERR and STDOUT to a logfile instead of /dev/null
parent
a7323239
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/git/gitmaild
View file @
64b8ac17
...
...
@@ -59,6 +59,9 @@ my $BASEURL = "https://gitlab.flux.utah.edu/";
# the gitlab API
my
$BASEPATH
=
"
/home/git/repositories
";
# Path where logging info will be sent
my
$LOGFILE
=
"
/home/git/gitmaild.log
";
# If set, send to members, not archivemail, by default - ie. act as if
# noarchive=1 was passed in the URL
my
$NOARCHIVE_DEFAULT
=
0
;
...
...
@@ -122,7 +125,7 @@ $SIG{CHLD}="IGNORE";
if
(
!
$debug
)
{
chdir
("
/
")
||
die
"
can't chdir to /: $!
";
open
(
STDIN
,
"
< /dev/null
")
||
die
"
can't read /dev/null: $!
";
open
(
STDOUT
,
"
>
/dev/null
")
||
die
"
can't write to
/dev/null
: $!
";
open
(
STDOUT
,
"
>
>
$LOGFILE
")
||
die
"
can't write to
$LOGFILE
: $!
";
defined
(
my
$pid
=
fork
())
||
die
"
can't fork: $!
";
exit
if
$pid
;
# non-zero now means I am the parent
(
setsid
()
!=
-
1
)
||
die
"
Can't start a new session: $!
";
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment