Skip to content

Commit

Permalink
Merge branch 'master' into reduce-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
IronCore864 committed Aug 14, 2024
2 parents 9ab785b + 45629c6 commit 9f2c2c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Pebble

_Take control of your internal daemons!_
**Pebble** is a lightweight Linux service manager.

**Pebble** helps you to orchestrate a set of local service processes as an organised set. It resembles well known tools such as _supervisord_, _runit_, or _s6_, in that it can easily manage non-system processes independently from the system services, but it was designed with unique features that help with more specific use cases.
It helps you orchestrate a set of local processes as an organised set. It resembles well-known tools such as _supervisord_, _runit_, or _s6_, in that it can easily manage non-system processes independently from the system services. However, it was designed with unique features such as layered configuration and an HTTP API that help with more specific use cases.

If you need a way to manage one or more services in a container, or as a non-root user on a machine, Pebble might be for you. It handles service logs, service dependencies, and allows you to set up ongoing health checks. Plus, it has an "HTTP over unix socket" API for all operations, with simple UID-based access control.

Pebble is useful for developers who are building [Juju charms on Kubernetes](https://juju.is/docs/sdk/from-zero-to-hero-write-your-first-kubernetes-charm), creating [Rocks](https://documentation.ubuntu.com/rockcraft/en/latest/explanation/rocks/) or Docker images, or orchestrating services in the virtual machine.

## In this documentation

Expand Down
5 changes: 4 additions & 1 deletion internals/overlord/overlord.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func New(opts *Options) (*Overlord, error) {
if !osutil.IsDir(o.pebbleDir) {
return nil, fmt.Errorf("directory %q does not exist", o.pebbleDir)
}
if !osutil.IsWritable(o.pebbleDir) {
return nil, fmt.Errorf("directory %q not writable", o.pebbleDir)
}

statePath := filepath.Join(o.pebbleDir, cmd.StateFile)

backend := &overlordStateBackend{
Expand Down Expand Up @@ -256,7 +260,6 @@ func loadState(statePath string, restartHandler restart.Handler, backend state.B
patch.Init(s)
return s, restartMgr, nil
}

r, err := os.Open(statePath)
if err != nil {
return nil, nil, fmt.Errorf("cannot read the state file: %s", err)
Expand Down
4 changes: 3 additions & 1 deletion internals/overlord/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ func (s *State) Unlocker() (unlock func() (relock func())) {
// After too many unsuccessful checkpoint attempts, it panics.
func (s *State) Unlock() {
defer s.unlock()

if !s.modified || s.backend == nil {
return
}
Expand All @@ -293,6 +292,9 @@ func (s *State) Unlock() {
s.modified = false
return
}

logger.Noticef("Cannot write state file, retrying: %v", err)

time.Sleep(unlockCheckpointRetryInterval)
}
logger.Panicf("cannot checkpoint even after %v of retries every %v: %v", unlockCheckpointRetryMaxTime, unlockCheckpointRetryInterval, err)
Expand Down

0 comments on commit 9f2c2c2

Please sign in to comment.