Use shutdown -p now on FreeBSD, update instructions

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2025-10-18 13:47:52 +02:00
parent 44c8acff16
commit bfb3f925d9
No known key found for this signature in database
3 changed files with 7 additions and 3 deletions

View File

@ -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"),
}
}
};

View File

@ -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"
```

View File

@ -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