Skip to content

Instantly share code, notes, and snippets.

@jfrost
Created March 17, 2015 00:32
Show Gist options
  • Save jfrost/0b995de75211984db10b to your computer and use it in GitHub Desktop.
Save jfrost/0b995de75211984db10b to your computer and use it in GitHub Desktop.
if os.getuid() != 0:
print _("You need to be root to run this application")
sys.exit(1)
# nice & ionce
os.nice(19)
subprocess.call(["ionice","-c3", "-p",str(os.getpid())])
# run the main code
main(options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment