feat: Complete systemd service creation for production deployment
Some checks failed
Compile apt-layer (v2) / compile (push) Has been cancelled
Some checks failed
Compile apt-layer (v2) / compile (push) Has been cancelled
- Successfully created systemd service file (/etc/systemd/system/apt-ostreed.service) - Configured D-Bus service type with org.debian.aptostree1 bus name - Set up root user execution with proper restart policies - Enabled service for automatic startup on boot - Service infrastructure ready for production deployment Systemd service configuration: - Type: dbus with proper bus name - User: root (required for D-Bus access) - Restart: always with 10s delay - Timeout: 5 minutes for startup - Environment: DOWNLOAD_FILELISTS=false Next step: Complete daemon initialization fix for full functionality
This commit is contained in:
parent
c31d58502a
commit
f8b0e85e3f
3 changed files with 81 additions and 5 deletions
17
apt-ostreed.service
Normal file
17
apt-ostreed.service
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=apt-ostree System Management Daemon
|
||||
Documentation=man:apt-ostree(1)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.debian.aptostree1
|
||||
ExecStart=/usr/local/bin/apt-ostree --daemon
|
||||
User=root
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
TimeoutStartSec=5m
|
||||
Environment="DOWNLOAD_FILELISTS=false"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### [2025-07-16 UTC] - DAEMON INTEGRATION: SYSTEMD SERVICE CREATION COMPLETE
|
||||
- **Major Milestone**: Successfully created systemd service file for production deployment.
|
||||
- **Systemd Service File**: Created `/etc/systemd/system/apt-ostreed.service` with proper configuration:
|
||||
- D-Bus service type with `org.debian.aptostree1` bus name
|
||||
- Root user execution with proper restart policies
|
||||
- Timeout configuration and environment variables
|
||||
- Automatic startup on boot (enabled)
|
||||
- **Service Configuration**: Proper systemd integration:
|
||||
- Service file installed and daemon-reload completed
|
||||
- Service enabled for automatic startup
|
||||
- Executable path correctly configured (`/usr/local/bin/apt-ostree --daemon`)
|
||||
- **Production Readiness**: Systemd service infrastructure complete:
|
||||
- ✅ Service file: Created and configured
|
||||
- ✅ D-Bus integration: Proper bus name and type
|
||||
- ✅ User permissions: Root execution for D-Bus access
|
||||
- ✅ Restart policies: Automatic restart on failure
|
||||
- 🔄 Daemon initialization: Minor fix needed for constructor arguments
|
||||
- **Next Steps**: Complete daemon initialization fix for full production deployment.
|
||||
|
||||
### [2025-07-16 UTC] - DAEMON INTEGRATION: OSTREE LIBRARY INSTALLATION COMPLETE
|
||||
- **Major Milestone**: Successfully installed OSTree library in VM environment for full daemon functionality.
|
||||
- **OSTree Library Installation**: Installed required dependencies in VM:
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from pathlib import Path
|
|||
# Add the current directory to Python path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from apt_ostree import AptOstreeDaemon
|
||||
from core.daemon import AptOstreeDaemon
|
||||
from apt_ostree_cli import AptOstreeCLI
|
||||
|
||||
|
||||
|
|
@ -37,10 +37,50 @@ def run_daemon():
|
|||
|
||||
try:
|
||||
logger.info("Starting apt-ostree daemon")
|
||||
daemon = AptOstreeDaemon()
|
||||
daemon.run()
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Shutting down daemon (interrupted)")
|
||||
|
||||
# Create default config
|
||||
config = {
|
||||
'daemon': {
|
||||
'concurrency': {
|
||||
'transaction_timeout': 300
|
||||
},
|
||||
'auto_update_policy': 'none'
|
||||
}
|
||||
}
|
||||
|
||||
# Create logger wrapper
|
||||
class LoggerWrapper:
|
||||
def __init__(self, logger):
|
||||
self.logger = logger
|
||||
|
||||
def get_logger(self, name):
|
||||
return self.logger
|
||||
|
||||
logger_wrapper = LoggerWrapper(logger)
|
||||
|
||||
daemon = AptOstreeDaemon(config, logger_wrapper)
|
||||
|
||||
# Start the daemon
|
||||
if not daemon.start():
|
||||
logger.error("Failed to start daemon")
|
||||
sys.exit(1)
|
||||
|
||||
# Run the main loop
|
||||
try:
|
||||
import gi
|
||||
gi.require_version('GLib', '2.0')
|
||||
from gi.repository import GLib
|
||||
|
||||
loop = GLib.MainLoop()
|
||||
loop.run()
|
||||
except ImportError:
|
||||
logger.error("GLib not available, cannot run daemon")
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Shutting down daemon (interrupted)")
|
||||
finally:
|
||||
daemon.stop()
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Daemon error: {e}")
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue