published on

python init.d script

I didn’t really think it should be done, I just wanted to see it be done. I wrote an init script for my rtorrent setup (which i should probably write about one of these days) entirely in python. I learned from my mistakes: I was forking just to get certain things to be executed as an unprivileged user, just so I could do future things as root, because i was using os.setuid instead of os.seteuid. Lesson learned, and I’ll probably rewrite it correctly, but I learned a little bit with some hands on forking…

okay, it’s now more like 10pm, and i tried just setting the effective id, but the screen didn’t quite get started as rtorrent, it still got started as root. very odd. turns out i did it right serendipitously!