Skip to content
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

systemd service unit fixes #109

Merged
merged 6 commits into from
Jan 17, 2024
Merged

systemd service unit fixes #109

merged 6 commits into from
Jan 17, 2024

Conversation

abeltrano
Copy link
Contributor

@abeltrano abeltrano commented Jan 17, 2024

Type

  • Bug fix
  • Feature addition
  • Feature update
  • Documentation
  • Build Infrastructure

Side Effects

  • Breaking change
  • Non-functional change

Goals

  • Ensure installed systemd unit files work properly.

Technical Details

  • During install step, create the empty directory structure for the hostapd control file specific in the example configuration file (eg. the "run state" directory).
  • Change hostapd service type from forking to simple and remove extra corresponding service lines (PIDFile) and daemon arguments (-B, -P).
  • Change netremote-server unit ExecStartfromsbintobin` where it's actually installed.

Test Results

  • Performed the following commands:
    • cmake --build /home/shadowfax/src/microsoft/netremote-cmake/out/build/dev-linux --parallel 14 --target install
    • cd /etc/systemd/system
    • sudo ln -s /home/shadowfax/src/microsoft/netremote-cmake/out/build/dev-linux/install/etc/systemd/system/[email protected]
    • sudo ln -s /home/shadowfax/src/microsoft/netremote-cmake/out/build/dev-linux/install/etc/systemd/system/netremote-server.service
    • sudo systemctl daemon-reload
    • sudo systemctl enable hostapd@wlan0
    • sudo systemctl start hostapd@wlan0
    • sudo systemctl status [email protected] netremote-server.service

Verfidied below output showed both services as active/running:

[email protected] - Hostapd Daemon
     Loaded: loaded (/etc/systemd/system/[email protected]; enabled; preset: enabled)
     Active: active (running) since Tue 2024-01-16 20:58:43 MST; 12min ago
   Main PID: 18192 (hostapd)
      Tasks: 1 (limit: 38513)
     Memory: 1.0M
     CGroup: /system.slice/system-hostapd.slice/[email protected]
             └─18192 /home/shadowfax/src/microsoft/netremote-cmake/out/install/dev-linux/sbin/hostapd -i wlan0 /home/shadowfax/src/microsoft/netremote-cmake/out/install/dev-linux/etc/hostapd/hostapd-wlan0.conf

Jan 16 20:58:43 foxmulder systemd[1]: [email protected]: Changed failed -> running
Jan 16 20:58:43 foxmulder systemd[1]: [email protected]: Job 1452 [email protected]/start finished, result=done
Jan 16 20:58:43 foxmulder systemd[1]: Started [email protected] - Hostapd Daemon.
Jan 16 20:58:43 foxmulder (hostapd)[18192]: [email protected]: Executing: /home/shadowfax/src/microsoft/netremote-cmake/out/install/dev-linux/sbin/hostapd -i wlan0 /home/shadowfax/src/microsoft/netremote-cmake/out/install/dev-linux/etc/hostapd/hostapd-wla>
Jan 16 20:58:43 foxmulder hostapd[18192]: wlan0: interface state UNINITIALIZED->ENABLED
Jan 16 20:58:43 foxmulder hostapd[18192]: wlan0: AP-ENABLED
Jan 16 21:02:28 foxmulder systemd[1]: [email protected]: Current command vanished from the unit file.
...

● netremote-server.service - Netremote Daemon
     Loaded: loaded (/etc/systemd/system/netremote-server.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-01-16 20:36:17 MST; 34min ago
   Main PID: 6373 (netremote-serve)
      Tasks: 18 (limit: 38513)
     Memory: 5.3M
     CGroup: /system.slice/netremote-server.service
             └─6373 /home/shadowfax/src/microsoft/netremote-cmake/out/install/dev-linux/bin/netremote-server

Jan 16 20:36:17 foxmulder systemd[1]: Started netremote-server.service - Netremote Daemon.
...

Reviewer Focus

  • Consider whether this would work for other development use cases.

Future Work

  • Create a cmake configure preset that sets installDir like a typical installation (eg. /).

Checklist

  • Build target all compiles cleanly.
  • clang-format and clang-tidy deltas produced no new output.
  • Newly added functions include doxygen-style comment block.

@abeltrano abeltrano requested a review from a team as a code owner January 17, 2024 04:14
@abeltrano abeltrano merged commit 7e5f414 into develop Jan 17, 2024
4 checks passed
@abeltrano abeltrano deleted the xtraargfix branch January 17, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant