Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tetras-back
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
Tetras-back
Commits
e9920256
Unverified
Commit
e9920256
authored
Jan 19, 2017
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
remove useless sig handle
parent
ee8cf78f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tetras-back
+3
-4
3 additions, 4 deletions
src/tetras-back
with
3 additions
and
4 deletions
src/tetras-back
+
3
−
4
View file @
e9920256
...
@@ -168,16 +168,16 @@ sub do_backup($){
...
@@ -168,16 +168,16 @@ sub do_backup($){
my
$name
=
$
CFG::
CFG
{
DISKS
}{
KNOWN
}{
$uuid
}{
name
};
my
$name
=
$
CFG::
CFG
{
DISKS
}{
KNOWN
}{
$uuid
}{
name
};
my
$pid
=
0
;
my
$pid
=
0
;
my
$error
=
0
;
my
$error
=
0
;
$SIG
{
KILL
}
=
sub
{
$error
=
2
;};
$SIG
{
KILL
}
=
sub
{
$Logger
->
alert
("
Tué pendant la sauvegarde
");
$error
=
2
;
kill
("
SIGTERM
",
$pid
)
;};
$Logger
->
info
("
Demarrage de la sauvegarde sur le disque:
$name
");
$Logger
->
info
("
Demarrage de la sauvegarde sur le disque:
$name
");
# Start each script
# Start each script
for
my
$scr
(
keys
%
{
$
CFG::
CFG
{'
SCRIPTS
'}}){
for
my
$scr
(
keys
%
{
$
CFG::
CFG
{'
SCRIPTS
'}}){
my
$cmd
=
"
$CFG
::CFG{'scriptdir'}/
$scr
$CFG
::CFG{'SCRIPTS'}{
$scr
}
$disc
";
my
$cmd
=
"
$CFG
::CFG{'scriptdir'}/
$scr
$CFG
::CFG{'SCRIPTS'}{
$scr
}
$disc
";
$Logger
->
info
("
Lancement du script de sauvegarde '
$CFG
::CFG{'scriptdir'}/
$scr
'
");
$Logger
->
info
("
Lancement du script de sauvegarde '
$CFG
::CFG{'scriptdir'}/
$scr
'
");
$pid
=
open
SCRLOG
,
'
-|
',
"
$cmd
2>&1
";
$pid
=
open
SCRLOG
,
'
-|
',
"
$cmd
2>&1
";
$SIG
{
KILL
}
=
sub
{
$error
=
2
;
kill
("
SIGTERM
",
$pid
);};
# Forward script output
# Forward script output
while
(
my
$line
=
<
SCRLOG
>
){
while
(
my
$line
=
<
SCRLOG
>
){
utf8::
decode
(
$line
);
$Logger
->
info
(
$line
);
$Logger
->
info
(
$line
);
}
}
if
(
!
close
(
SCRLOG
)){
if
(
!
close
(
SCRLOG
)){
...
@@ -189,7 +189,6 @@ sub do_backup($){
...
@@ -189,7 +189,6 @@ sub do_backup($){
}
}
$Logger
->
info
("
Script de sauvegarde
$scr
terminé
");
$Logger
->
info
("
Script de sauvegarde
$scr
terminé
");
}
}
$SIG
{
KILL
}
=
sub
{
$error
=
2
;};
# Tell main thread that we are done
# Tell main thread that we are done
return
end_backup
(
$name
,
$error
);
return
end_backup
(
$name
,
$error
);
}
}
...
@@ -321,7 +320,7 @@ sub start_daemon(){
...
@@ -321,7 +320,7 @@ sub start_daemon(){
$
CFG::
CFG
{
DISKS
}{
KNOWN
}{
$uuid
}{'
last_seen
'}
=
time
();
$
CFG::
CFG
{
DISKS
}{
KNOWN
}{
$uuid
}{'
last_seen
'}
=
time
();
}
}
if
(
exists
(
$running_backups
{
$uuid
})){
if
(
exists
(
$running_backups
{
$uuid
})){
$Logger
->
alert
("
Arrach
ement
de disque
");
$Logger
->
alert
("
Arrach
age
de disque
");
# Kill the thread
# Kill the thread
$running_backups
{
$uuid
}
->
kill
('
SIGKILL
');
$running_backups
{
$uuid
}
->
kill
('
SIGKILL
');
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment