mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
run restarter on startup
This commit is contained in:
committed by
Keagan McClelland
parent
1a66a5d240
commit
1da2da7e43
@@ -41,6 +41,7 @@ import System.FilePath.Posix ( takeDirectory )
|
|||||||
import System.Directory
|
import System.Directory
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import System.Posix.Files
|
import System.Posix.Files
|
||||||
|
import System.Process ( callCommand )
|
||||||
import qualified Streaming.Prelude as Stream
|
import qualified Streaming.Prelude as Stream
|
||||||
import qualified Streaming.Conduit as Conduit
|
import qualified Streaming.Conduit as Conduit
|
||||||
import qualified Streaming.Zip as Stream
|
import qualified Streaming.Zip as Stream
|
||||||
@@ -550,7 +551,8 @@ syncRestarterService = SyncOp "Install Restarter Service" check migrate True
|
|||||||
base <- asks $ appFilesystemBase . appSettings
|
base <- asks $ appFilesystemBase . appSettings
|
||||||
liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.service" `relativeTo` base) wantedService
|
liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.service" `relativeTo` base) wantedService
|
||||||
liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.timer" `relativeTo` base) wantedTimer
|
liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.timer" `relativeTo` base) wantedTimer
|
||||||
liftIO . run $ systemctl "enable" "restarter.timer"
|
liftIO $ callCommand "systemctl enable restarter.service"
|
||||||
|
liftIO $ callCommand "systemctl enable restarter.timer"
|
||||||
|
|
||||||
failUpdate :: S9Error -> ExceptT Void (ReaderT AgentCtx IO) ()
|
failUpdate :: S9Error -> ExceptT Void (ReaderT AgentCtx IO) ()
|
||||||
failUpdate e = do
|
failUpdate e = do
|
||||||
|
|||||||
Reference in New Issue
Block a user