Support daemonization of GPG agent
This commit is contained in:
@@ -226,6 +226,8 @@ def run_agent(device_type):
|
||||
p.add_argument('-v', '--verbose', default=0, action='count')
|
||||
p.add_argument('--server', default=False, action='store_true',
|
||||
help='Use stdin/stdout for communication with GPG.')
|
||||
p.add_argument('--daemon', default=False, action='store_true',
|
||||
help='Daemonize the agent.')
|
||||
|
||||
p.add_argument('--pin-entry-binary', type=str, default='pinentry',
|
||||
help='Path to PIN entry UI helper.')
|
||||
@@ -236,6 +238,15 @@ def run_agent(device_type):
|
||||
|
||||
args, _ = p.parse_known_args()
|
||||
|
||||
if args.daemon:
|
||||
with daemon.DaemonContext():
|
||||
run_agent_internal(args, device_type)
|
||||
else:
|
||||
run_agent_internal(args, device_type)
|
||||
|
||||
|
||||
def run_agent_internal(args, device_type):
|
||||
"""Actually run the server."""
|
||||
assert args.homedir
|
||||
|
||||
log_file = os.path.join(args.homedir, 'gpg-agent.log')
|
||||
|
||||
Reference in New Issue
Block a user