<s> import logging <EOL> from sys import argv <EOL> from daemonize import Daemonize <EOL> pid = argv [ <NUM_LIT:1> ] <EOL> log = argv [ <NUM_LIT:2> ] <EOL> logger = logging . getLogger ( __name__ ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> logger . propagate = False <EOL> fh = logging . FileHandler ( log , "<STR_LIT:w>" ) <EOL> fh . setLevel ( logging . DEBUG ) <EOL> logger . addHandler ( fh ) <EOL> keep_fds = [ fh . stream . fileno ( ) ] <EOL> def privileged_action ( ) : <EOL> logger . info ( "<STR_LIT>" ) <EOL> def action ( ) : <EOL> logger . info ( "<STR_LIT>" ) <EOL> daemon = Daemonize ( app = "<STR_LIT>" , pid = pid , action = action , <EOL> privileged_action = privileged_action , logger = logger , keep_fds = keep_fds ) <EOL> daemon . start ( ) </s>
