in Hacker School

Hacker School Day 4 – Daemons, init scripts, presentations

I was tired this morning because I ended up staying late last night. I fought with a bug in the Zulip <-> IRC transport that I couldn’t see, because the script was daemonized. I eventually added logging and an option not to daemonize, and even after that only hunted down the problem thanks to strace.

I hit an annoying problem with the translations file. I want to be able to type ‘<3’, and have it be converted into a heart in Zulip (which requires one to write ‘:heart:’). I did this with many smile faces as well. It turns out that this makes for a very grumpy JSON parser. I may need to submit a bug report on the JSON module, as long as I can shrink the problematic smiley down. I felt bad about using JSON anyway, since it’s not a very good config file format (no comments).

Today I worked on making the act of starting the transport easier. Before today, starting the transport meant:

  • making sure ii and zulip-irc-ii.pl weren’t already running
  • starting ii with the right flags
  • echoing into the FIFO for it to join the channel
  • starting zulip-irc-ii.pl with the growing list of options

I had so many flags going on that it was becoming cumbersome to stop and start the daemon. I copied my init script from neilforobot (another perl IRC bot I have) and went to town.

After a lot of annoying start-stop-daemon issues, I finished. I separated out the relevant variables into a bash configuration file and uploaded to GitHub. I can now start, stop, restart, or check the status of the transport.

I started working on the presentation for tonight. Thursdays at Hacker School are presentation days and I want to show off zulip-to-irc. I’ve finished the slides, but don’t want to link them yet, since I haven’t presented. edit: They’re here

My original plan for today was to work on cleaning up the init script for 2 hours, work on the presentation for two hours, work on name translation for 2 hours, and then switching the config files to YAML. I ended up spending the 2 hours fixing weird init script problems, then ate lunch (surprise — that takes time too!) I finished up the slides about an hour ago and am now feeling tired. I decided to write this post rather than keep going. I know the transport works at this point anyway, and don’t want to mess it up.

I spent some time cleaning up the README and POD in the perl script as well. I might spend another day or so on this project before switching to something new. Maybe Clojure?

Write a Comment

Comment