Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
O
onionkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
segfault
onionkit
Commits
e6685e00
Commit
e6685e00
authored
Mar 04, 2018
by
segfault
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --debug option to pause execution for debugging in some error cases
parent
71916f3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
onionkit/__init__.py
onionkit/__init__.py
+3
-0
onionkit/container.py
onionkit/container.py
+6
-0
scripts/onionkitd
scripts/onionkitd
+3
-0
No files found.
onionkit/__init__.py
View file @
e6685e00
...
...
@@ -22,6 +22,9 @@ SERVICES_PATH = BASE_PATH
MACHINE_DIR
=
"/var/lib/machines"
SYSTEMD_UNIT_DIR
=
"/lib/systemd/system"
# Indicates whether the current execution is for debugging purposes
DEBUG
=
False
# --- Translation stuff --- #
import
gettext
...
...
onionkit/container.py
View file @
e6685e00
...
...
@@ -8,6 +8,7 @@ import subprocess
import
sh
from
onionkit
import
_
from
onionkit
import
DEBUG
from
onionkit
import
CONTAINER_BASE
,
MACHINE_DIR
,
SYSTEMD_UNIT_DIR
from
typing
import
List
...
...
@@ -293,5 +294,10 @@ class ContainerManager(object):
self
.
start
()
try
:
yield
except
Exception
as
e
:
if
DEBUG
:
logger
.
exception
(
e
)
input
(
"Paused to allow debugging. Press Enter to continue"
)
raise
finally
:
self
.
stop
()
scripts/onionkitd
View file @
e6685e00
...
...
@@ -94,6 +94,7 @@ class TorManager(object):
def
parse_args
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--verbose"
,
"-v"
,
action
=
"count"
)
parser
.
add_argument
(
"--debug"
,
action
=
"store_true"
,
help
=
"Pause the execution in some error cases to allow debugging"
)
parser
.
add_argument
(
"--log-file"
,
"-l"
)
return
parser
.
parse_args
()
...
...
@@ -101,6 +102,8 @@ def parse_args():
def
main
():
args
=
parse_args
()
onionkit
.
logger
.
initialize
(
args
.
verbose
,
args
.
log_file
)
if
args
.
debug
:
onionkit
.
DEBUG
=
True
OnionKit
().
register
()
...
...
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