# Service exited after 10 seconds

**URL:** <https://forums.balena.io/t/service-exited-after-10-seconds/370374>\
**Category:** Project help\
**Tags:** support, docker, network, raspberrypi4\
**Created:** [April 25, 2024, 2:51pm UTC](https://forums.balena.io/t/service-exited-after-10-seconds/370374 "2024-04-25T14:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbone](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@tbone](https://forums.balena.io/u/tbone)\
**Post date:** [April 25, 2024, 2:51pm UTC](https://forums.balena.io/t/service-exited-after-10-seconds/370374/1 "2024-04-25T14:51:08Z")

</div>

Hi,

I am new to balena and are currently developing a multiple service fleet. After quite some testing I encountered a behaviour I can not understand.

I start/build a service via `balena push <fleet>`. The the service correctly is deployed to my device (raspberry pi compute module 4). Then the service starts. But after approximately 10 seconds the service exits, restarts and so on …

I reduced my problem to this small example:

> **Directory setup**
>
> MyProject/  
> ├── docker-compose.yml  
> ├── testservice/  
> │ ├── Dockerfile  
> │ └── script.sh

> **Dockerfile**
>
> ```auto
> FROM ubuntu:20.04
> 
> COPY /test/script.sh script.sh
> 
> RUN chmod +x script.sh
> 
> CMD ["./script.sh"]
> 
> ```

> **docker-compose.yml**
>
> ```auto
> version: "2.1"
> 
> services:
> test:
> build:
> context: .
> dockerfile: ./test/Dockerfile
> # init: true
> # network_mode: host
> # restart: always
> # privileged: true
> 
> ```
> 
> the commented tags are some of the options I already tried it with.

> **script.sh**
>
> ```auto
> #!/bin/bash
> 
> while true; do
> echo "Service running"
> sleep 1  
> done
> 
> ```

Here you see the output:

```auto
2024-04-25T14:44:55+00:00 Starting service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:44:56+00:00 Started service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:44:56+00:00 test Service running
2024-04-25T14:44:56+00:00 test Service running
2024-04-25T14:44:57+00:00 Killing service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:44:57+00:00 test Service running
2024-04-25T14:44:58+00:00 test Service running
2024-04-25T14:44:59+00:00 test Service running
2024-04-25T14:45:00+00:00 test Service running
2024-04-25T14:45:01+00:00 test Service running
2024-04-25T14:45:02+00:00 test Service running
2024-04-25T14:45:03+00:00 test Service running
2024-04-25T14:45:04+00:00 test Service running
2024-04-25T14:45:05+00:00 test Service running
2024-04-25T14:45:06+00:00 test Service running
2024-04-25T14:45:07+00:00 test Service running
2024-04-25T14:45:08+00:00 Service exited 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:08+00:00 Killed service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:08+00:00 Installing service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:08+00:00 Installed service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:08+00:00 Starting service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:09+00:00 Started service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:09+00:00 test Service running
2024-04-25T14:45:09+00:00 test Service running
2024-04-25T14:45:10+00:00 Killing service 'test sha256:0ed692de9b4e312d9303e110186b0f075216c8708196d29ab1e34bb4c0841203'
2024-04-25T14:45:10+00:00 test Service running

```

It goes on like this forever.

I have BalenaOS dev installed and installed it via the balena etcher. I develop on WSL on a Debian system.

I already tried the “usual” things that I could think of: reboot, delete devices, create new fleet, update, …

Any help would be highly welcome.

Thanks in advance  
Thomas

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [May 2, 2024, 10:31am UTC](https://forums.balena.io/t/service-exited-after-10-seconds/370374/2 "2024-05-02T10:31:36Z")

</div>

Hello @tbone could you please share more details on the balenaOS and supervisor versions?

What type of Raspberry Pi CM4 device are you using?

Thanks!
