Skip to content

systemd service unit fixes#109

Merged
abeltrano merged 6 commits into
developfrom
xtraargfix
Jan 17, 2024
Merged

systemd service unit fixes#109
abeltrano merged 6 commits into
developfrom
xtraargfix

Conversation

@abeltrano
Copy link
Copy Markdown
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/hostapd@.service
    • 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 hostapd@wlan0.service netremote-server.service

Verfidied below output showed both services as active/running:

● hostapd@wlan0.service - Hostapd Daemon
     Loaded: loaded (/etc/systemd/system/hostapd@wlan0.service; 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/hostapd@wlan0.service
             └─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]: hostapd@wlan0.service: Changed failed -> running
Jan 16 20:58:43 foxmulder systemd[1]: hostapd@wlan0.service: Job 1452 hostapd@wlan0.service/start finished, result=done
Jan 16 20:58:43 foxmulder systemd[1]: Started hostapd@wlan0.service - Hostapd Daemon.
Jan 16 20:58:43 foxmulder (hostapd)[18192]: hostapd@wlan0.service: 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]: hostapd@wlan0.service: 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
@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