Skip to content

Kill existing process when atomic-server boots #167

@joepio

Description

@joepio

Upon opening atomic-server, earlier running instances should be closed.
This would make a deploy script #165 far easier to realize, and it would be something that I'd personally want as a behavior.

I need to do two things:

  • Detect if a process is running
  • Kill the process

Detect process by using .pid file

I can create a text file file in ~/.config/atomic/pid that contains the pid of a running server, which removes the .pid when a server is running.

Detect process by checking if DB can be openend

The .init() function of DB errors if the DB file is locked. We can use this to check if the process is running. But we still cant kill it.. Probably need a pid!

Kill the process using a cross-platform library

Seems like the heim crate has what I need!I

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions