Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Zheng
slapos.core
Commits
9766a78a
Commit
9766a78a
authored
Oct 02, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI: supervisor command: allow to bypass root check.
parent
4f4a9793
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
slapos/cli/supervisorctl.py
slapos/cli/supervisorctl.py
+14
-2
No files found.
slapos/cli/supervisorctl.py
View file @
9766a78a
...
@@ -3,10 +3,12 @@
...
@@ -3,10 +3,12 @@
import
argparse
import
argparse
import
os
import
os
from
slapos.cli.command
import
must_be_root
from
slapos.cli.command
import
check_root_user
from
slapos.cli.config
import
ConfigCommand
from
slapos.cli.config
import
ConfigCommand
from
slapos.grid.svcbackend
import
launchSupervisord
from
slapos.grid.svcbackend
import
launchSupervisord
from
slapos.util
import
string_to_boolean
import
supervisor.supervisorctl
import
supervisor.supervisorctl
...
@@ -23,9 +25,19 @@ class SupervisorctlCommand(ConfigCommand):
...
@@ -23,9 +25,19 @@ class SupervisorctlCommand(ConfigCommand):
help
=
'parameters passed to supervisorctl'
)
help
=
'parameters passed to supervisorctl'
)
return
ap
return
ap
@
must_be_root
def
_should_check_current_user_is_root
(
self
,
configp
):
if
not
configp
.
has_option
(
'slapos'
,
'root_check'
):
return
True
return
configp
.
getboolean
(
'slapos'
,
'root_check'
)
def
take_action
(
self
,
args
):
def
take_action
(
self
,
args
):
configp
=
self
.
fetch_config
(
args
)
configp
=
self
.
fetch_config
(
args
)
# Parse if we have to check if running from root
# XXX document this feature.
if
self
.
_should_check_current_user_is_root
(
configp
):
check_root_user
(
self
)
instance_root
=
configp
.
get
(
'slapos'
,
'instance_root'
)
instance_root
=
configp
.
get
(
'slapos'
,
'instance_root'
)
configuration_file
=
os
.
path
.
join
(
instance_root
,
'etc'
,
'supervisord.conf'
)
configuration_file
=
os
.
path
.
join
(
instance_root
,
'etc'
,
'supervisord.conf'
)
launchSupervisord
(
socket
=
os
.
path
.
join
(
instance_root
,
'supervisord.socket'
),
launchSupervisord
(
socket
=
os
.
path
.
join
(
instance_root
,
'supervisord.socket'
),
...
...
Write
Preview
Markdown
is supported
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