Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
immerda
Puppet Modules
webhosting
Commits
a70c0d33
Commit
a70c0d33
authored
Jun 24, 2019
by
mh
Browse files
append log to the user log
parent
edc37ec8
Changes
1
Hide whitespace changes
Inline
Side-by-side
files/update_scripts/auto_update_wordess.rb
View file @
a70c0d33
...
...
@@ -81,11 +81,11 @@ Dir['/var/www/vhosts/*/scripts/update_wordpress/update_wordpress.dirs'].each do
run_file
=
File
.
join
(
dir
,
'update_wordpress.auto_run'
)
uid
=
Etc
.
getpwnam
(
vhost_options
[
'sftp_user'
]).
uid
gid
=
Etc
.
getgrnam
(
vhost_options
[
'group'
]).
gid
sudo
(
uid
,
gid
)
do
FileUtils
.
touch
run_file
end
FileUtils
.
touch
run_file
File
.
chown
(
uid
,
gid
,
run_file
)
result
=
`/opt/webhosting_user_scripts/update_wordpress/update_wordpress.rb
#{
run_file
}
2>&1`
exit_code
=
$?
.
to_i
File
.
open
(
File
.
join
(
dir
,
'update_wordpress.log'
),
'a'
){
|
f
|
f
<<
result
}
if
exit_code
>
0
error_log
"Error while running update for
#{
hosting
}
- Exitcode:
#{
exit_code
}
-
#{
result
}
"
inform_about_error
(
sender
,
vhost_options
[
'hosting_contact'
],
hosting
,
exit_code
,
result
,
uid
,
gid
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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