Skip to content

Daemon process#90

Merged
endaaman merged 8 commits intomasterfrom
daemon
Jan 24, 2023
Merged

Daemon process#90
endaaman merged 8 commits intomasterfrom
daemon

Conversation

@endaaman
Copy link
Copy Markdown
Owner

@endaaman endaaman commented Jan 11, 2023

Adding --daemon

  • The daemon process has no windows.
  • When the daemon process exist, new executions will exit imediatelly and the instance will be created in the daemon process.
  • --isolated process will not be united into the daemon process (it will has always an unique process by an instance).

TODOs

  • PoC implementation
  • add systemd unit
  • update README

@endaaman endaaman changed the title [WIP] Daemon [WIP] Daemon process Jan 11, 2023
@endaaman endaaman mentioned this pull request Jan 11, 2023
@endaaman
Copy link
Copy Markdown
Owner Author

endaaman commented Jan 12, 2023

The basic implementation has been done.

You can try like the followings.

$ yay -S tym-git --editmenu

and edit the line source=('tym::git+https://github.com/endaaman/tym#branch=master') from master to daemon.

Usage

When there is no tym instance, run below.

$ tym --daemon

The process will be daemon process. This execution is wrapped as systemd-unit.

$ systemctl --user start tym-daemon.service

However, this will also failed in your working tym instance. To start the daemon process, we need to stop all tym instances including the terminal just you are working on!

So the following may help you.

$ nohup sh -c 'killall tym; sleep 1; systemctl --user start tym-daemon.service; tym' >/dev/null 2>&1 &

@sammy-ette
Copy link
Copy Markdown

sammy-ette commented Jan 14, 2023

sometimes when i try to run an instance, it exits with no error (with a log of just quit).
i see that this is intentional, but this happens with subsequent instances?

@endaaman
Copy link
Copy Markdown
Owner Author

endaaman commented Jan 16, 2023

The application ID may be the cause.

tym instances unite by application ID such as me.endaaman.tym or me.endaaman.tym_dev. For debugging, the latter me.endaaman.tym_dev is used by specifying $ ./configure --endable-debug. If you are developing on tym and didn't specify --endable-debug option, the tym process that you are working on uses me.endaaman.tym and the newly developing execution will be united into it.

On the other hand., if you feel curious that when the daemon/primary process exists, all secondary tym executions will quit immediately, that is just the specification of tym. If you need logs also on the secondary executions, there is a means of receiving log messages from the primary/daemon process using D-Bus IPC.

@endaaman endaaman changed the title [WIP] Daemon process Daemon process Jan 24, 2023
@endaaman endaaman merged commit b02354d into master Jan 24, 2023
@endaaman endaaman deleted the daemon branch January 24, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants