The rebuild subcommand now executes the full pipeline: - build_registry() -> resolve() -> sched::run() - install::install() for each built package - service::install_service() for enabled services - boot::install_bootloader_config() for bootloader config - system::write_hostname() / write_timezone() for system activation Added --dry-run flag for report-only behavior (backward compat with test suite). Added -w flag for worker parallelism and --dry-run to help. Fixed .gitignore: 'kappa' -> '/kappa' (was matching include/kappa/, preventing header files from being tracked since initial commit). This commit also adds all previously-gitignored header files.
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "kappa/dsl/ast.hpp"
|
|
#include "kappa/service/types.hpp"
|
|
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
namespace kappa::service {
|
|
|
|
struct ServiceSpec {
|
|
std::string name;
|
|
std::string description;
|
|
std::string exec;
|
|
std::string type;
|
|
std::string user;
|
|
std::vector<int> ports;
|
|
std::unordered_map<std::string, std::string> env;
|
|
std::string after;
|
|
std::string restart_policy;
|
|
std::string working_dir;
|
|
|
|
static ServiceSpec from_service_init(const dsl::NamedService& ns);
|
|
};
|
|
|
|
std::string generate_systemd_service(const ServiceSpec& spec);
|
|
std::string generate_s6_service(const ServiceSpec& spec);
|
|
std::string generate_openrc_service(const ServiceSpec& spec);
|
|
std::string generate_dinit_service(const ServiceSpec& spec);
|
|
std::string generate_runit_service(const ServiceSpec& spec);
|
|
std::string generate_service_file(InitSystem is, const ServiceSpec& spec);
|
|
|
|
struct ServiceInstallResult {
|
|
bool ok;
|
|
std::string path;
|
|
std::string error;
|
|
};
|
|
|
|
ServiceInstallResult install_service(
|
|
InitSystem is,
|
|
const ServiceSpec& spec,
|
|
std::string_view prefix = "/");
|
|
|
|
} // namespace kappa::service
|