-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make systemd config generation more resilient #74
Conversation
Looks good to me. The && everywhere is not necessary because "/bin/sh -e" already takes care of that, but you might as well keep it for readability. The same changes should be applied to the Upstart script: https://github.com/hyperboria/cjdns/blob/master/contrib/upstart/cjdns.conf |
Right, you said that on IRC when I brought it up -- bringing the semicolons back. |
Make systemd config generation more resilient
Now that I look at the updated diff, this line looks fishy:
Multi-line variables in shell scripts, like $conf, should be quouted. So it should end up like this eventually:
But you're already quoting the entire thing to get it out of systemd's parser, so you'll have to look up how to escape quotes in systemd docs. |
Also if EDIT: Might not be an issue in most systems (2MB in case of my Arch). |
Now that I think about it, "test -s" is all that's needed to fix that particular bug. We don't have to do any of this fishy store-and-echo stuff. You can just swap "test -e" for "test -s" and call it a day, and I think we really ought to do that. |
Not really. I've found a git recipe for rolling back a single file, should be this:
And then swap "-e" for "-s" and poof, done. But you'd have to tell the the correct branch-switching and your-changes-pulling and this-branch-pushing sequence too because last time I did that on git instead of bzr there were fireworks and I don't really want to go through it all again right now. |
Fix config generation failing permanently with a blank config file if cjdroute binary is not in $PATH the first time around. Should never happen in .deb packages (where this config is most used), but it's a reasonable robustness improvement nevertheless.
Propagate the changes from #74 to upstart script
We wanna make sure that it really really generates a config, or fails otherwise
cc @Shnatsel @kpcyrd