@@ -142,7 +142,16 @@ const runArchiveRunner = Effect.fn("test.runArchiveRunner")(
142142) ;
143143
144144describe ( "ssh tunnel scripts" , ( ) => {
145- it . live . each ( [ "launchd" , "systemd" , "none" ] as const ) (
145+ const serviceManagers = [
146+ "launchd" ,
147+ "systemd" ,
148+ "systemd-unavailable" ,
149+ "systemd-unavailable-xdg" ,
150+ "systemd-unavailable-relative-xdg" ,
151+ "systemd-unavailable-login-xdg" ,
152+ "none" ,
153+ ] as const ;
154+ it . live . each ( serviceManagers ) (
146155 "respects %s service ownership when the server is stopped" ,
147156 ( manager ) =>
148157 Effect . gen ( function * ( ) {
@@ -175,12 +184,27 @@ esac
175184 yield * fs . makeDirectory ( agents , { recursive : true } ) ;
176185 yield * fs . writeFileString ( `${ agents } /com.t3tools.t3code.service.plist` , "installed" ) ;
177186 }
187+ const xdgConfigHome =
188+ manager === "systemd-unavailable-xdg" || manager === "systemd-unavailable-login-xdg"
189+ ? `${ root } /custom config`
190+ : manager === "systemd-unavailable-relative-xdg"
191+ ? "relative-config"
192+ : undefined ;
193+ if ( manager . startsWith ( "systemd-unavailable" ) ) {
194+ const units = `${ manager === "systemd-unavailable-xdg" ? xdgConfigHome : `${ root } /.config` } /systemd/user` ;
195+ yield * fs . makeDirectory ( units , { recursive : true } ) ;
196+ yield * fs . writeFileString ( `${ units } /t3code.service` , "installed" ) ;
197+ }
178198 const ssh = ChildProcessSpawner . make ( ( command ) => {
179199 if ( command . _tag !== "StandardCommand" ) return Effect . die ( "Expected SSH command" ) ;
180200 return spawner . spawn (
181201 ChildProcess . make ( "sh" , [ "-s" , "--" , "test-peer" ] , {
182202 ...command . options ,
183- env : { HOME : root , PATH : `${ bin } :/usr/bin:/bin` } ,
203+ env : {
204+ HOME : root ,
205+ PATH : `${ bin } :/usr/bin:/bin` ,
206+ ...( xdgConfigHome === undefined ? { } : { XDG_CONFIG_HOME : xdgConfigHome } ) ,
207+ } ,
184208 extendEnv : false ,
185209 } ) ,
186210 ) ;
0 commit comments