Page MenuHomePhabricator

[Nix] Move daemon creation to separate script
ClosedPublic

Authored by jon on Aug 18 2022, 3:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 16, 2:00 AM
Unknown Object (File)
Wed, Jan 1, 12:24 AM
Unknown Object (File)
Wed, Jan 1, 12:24 AM
Unknown Object (File)
Wed, Jan 1, 12:24 AM
Unknown Object (File)
Wed, Jan 1, 12:24 AM
Unknown Object (File)
Wed, Jan 1, 12:24 AM
Unknown Object (File)
Wed, Jan 1, 12:20 AM
Unknown Object (File)
Dec 22 2024, 4:58 PM

Details

Reviewers
abosh
varun
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rCOMM6f7a115ed9d0: [Nix] Move daemon creation to separate script
Summary

There's a desire to not have bash embedded
in a nix string, as it circumvents linting and some
CI checks. This is to pull the daemon creation
out to it's own separate file.

Test Plan
# If you have mariadb setup through homebrew, then run:
brew services stop mariadb

nix develop

Should see:

$ nix develop
View MariaDB Logs: tail -f $HOME/.local/share/MariaDB/logs
Kill MariaDB server: pkill mariadbd
Welcome to Comm dev environment! :)
[15:03:57] jon@Jons-MacBook-Pro ~/comm/comm (jonringer/web-services)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 18 2022, 3:05 PM

Awesome, this guarantees ShellCheck can take a look at the code before reviewers!

scripts/start_comm_daemon.sh
3 ↗(On Diff #15769)
3–10 ↗(On Diff #15769)

Not sure the rules on documenting bash files, but you can probably move these comments down instead of creating 4 new lines, right? This is more readable and concise to me.

13 ↗(On Diff #15769)

Also nit, which really is a nit because it doesn't matter, but I like two spaces between code and comments on the same line. I think this is because I had a professor in college who insisted on this, and now it's engrained in me. But also there's a lot of resources online that say the same thing, so it's something to think about. But if one space is something you like, don't change that, this is just a tiny nit.

This revision is now accepted and ready to land.Aug 19 2022, 12:16 PM
jon marked 3 inline comments as done.

Rebase, address comments

scripts/start_comm_daemon.sh
3 ↗(On Diff #15769)

The MariaDB daemon or mariadbd is the actual command to start the server. mariadbd is also more correct because mariadb is the prefix for many other client command which could troublesome when using pgrep.

3–10 ↗(On Diff #15769)

Fair point, was concerned about 80 char limit, but doesn't look like an issue