Custom Container Start Command Not Working

Hello, I want to create a custom template which clones a repo and then runs a script from that repo. However, the pods I've launched with it have failed to clone the repo, much less execute the script. Here is my container start command bash -c '/start.sh && git clone https://github.com/melembroucarlitos/pibbss-infra.git && cd pibbss-infra && chmod +x daemon.bash && ./daemon.bash'
GitHub
GitHub - melembroucarlitos/pibbss-infra: Runpod Monitoring Infrastr...
Runpod Monitoring Infrastructure for PIBBSS. Contribute to melembroucarlitos/pibbss-infra development by creating an account on GitHub.
7 Replies
digigoblin
digigoblin4w ago
You need to reverse it, start.sh usually contains sleep infinity and the git clone will never be reached Something like this:
bash -c 'git clone https://github.com/melembroucarlitos/pibbss-infra.git && cd pibbss-infra && chmod +x daemon.bash && ./daemon.bash & && /start.sh'
bash -c 'git clone https://github.com/melembroucarlitos/pibbss-infra.git && cd pibbss-infra && chmod +x daemon.bash && ./daemon.bash & && /start.sh'
justin
justin4w ago
+1^ to above: https://github.com/justinwlin/Runpod-GPU-And-Serverless-Base I'd also recommend to use my repository ;3 b/c I modify it so that the start.sh is easily editable, so u can add on whatever bash functions u want. And is easily extendable too
muddyfootprints.
Thanks, that helps Now another issue, I want to boot the daemon using systemctl but it shows that it systemd did not boot the machine. Is this true for all runpod machines? I'm running on the community cloud, in case that matters
muddyfootprints.
My init command is now bash -c 'git clone https://github.com/melembroucarlitos/pibbss-infra.git && chmod +x /pibbss-infra/daemon.sh && cp /pibbss-infra/daemon.sh /etc/init.d/idle_watcher && update-rc.d idle_watcher defaults && service idle_watcher start && /start.sh '
GitHub
GitHub - melembroucarlitos/pibbss-infra: Runpod Monitoring Infrastr...
Runpod Monitoring Infrastructure for PIBBSS. Contribute to melembroucarlitos/pibbss-infra development by creating an account on GitHub.
justin
justin4w ago
https://discord.com/channels/912829806415085598/948767517332107274/1248634065637085276 Ill link to an answer by @digigoblin where there is no systemctl. can use service instead tho im not familiar with these things
digigoblin
digigoblin4w ago
Yeah you can't use systemd in pods
Madiator2011 (Work)
service start name