diff --git a/build.zig b/build.zig index 74c59cb..3b9e833 100644 --- a/build.zig +++ b/build.zig @@ -134,6 +134,10 @@ pub fn Installer(install_config: bool) type { try patch_map.put("$PREFIX_DIRECTORY", prefix_directory); try patch_map.put("$EXECUTABLE_NAME", executable_name); + // The "-a" argument doesn't exist on FreeBSD, so we use "-p" + // instead to shutdown the system. + try patch_map.put("$PLATFORM_SHUTDOWN_ARG", if (init_system == .freebsd) "-p" else "-a"); + try install_ly(allocator, patch_map, install_config); try install_service(allocator, patch_map); } @@ -359,7 +363,7 @@ pub fn Uninstaller(uninstall_config: bool) type { }, .dinit => try deleteFile(allocator, config_directory, "/dinit.d/ly", "dinit service not found"), .sysvinit => try deleteFile(allocator, config_directory, "/init.d/ly", "sysvinit service not found"), - .freebsd => try deleteFile(allocator, config_directory, "/rc.d/ly", "freebsd service not found"), + .freebsd => try deleteFile(allocator, prefix_directory, "/bin/ly_wrapper", "freebsd wrapper not found"), } } }; diff --git a/readme.md b/readme.md index c9daae7..5a46679 100644 --- a/readme.md +++ b/readme.md @@ -178,7 +178,7 @@ To disable TTY 2, go to `/etc/inittab` and comment out the line containing `tty2 ### FreeBSD ``` -# zig build installexe -Dprefix_directory=/usr/local -Dinit_system=freebsd +# zig build installexe -Dprefix_directory=/usr/local -Dconfig_directory=/usr/local/etc -Dinit_system=freebsd # sysrc lightdm_enable="NO" ``` diff --git a/res/config.ini b/res/config.ini index cb229f7..e67c609 100644 --- a/res/config.ini +++ b/res/config.ini @@ -264,7 +264,7 @@ session_log = ly-session.log setup_cmd = $CONFIG_DIRECTORY/ly/setup.sh # Command executed when pressing shutdown_key -shutdown_cmd = /sbin/shutdown -a now +shutdown_cmd = /sbin/shutdown $PLATFORM_SHUTDOWN_ARG now # Specifies the key used for shutdown (F1-F12) shutdown_key = F1