FartingNicoNyanCats / authd

0 stars 4 forks source link

Improper removal of main IPC socket. #7

Open remydev opened 5 years ago

remydev commented 5 years ago
[remy@remy-pc bin]$ ./authd -u lalauser -d database1
bind: Address already in use
Unhandled exception: ipc_server_init < 0 (IPC::Exception)
  from /home/remy/lalatest/authd/lib/ipc/src/ipc.cr:93:4 in 'initialize'
  from /home/remy/lalatest/authd/lib/ipc/src/ipc.cr:0:3 in 'initialize'
  from /home/remy/lalatest/authd/lib/ipc/src/ipc.cr:100:2 in 'new'
  from /home/remy/lalatest/authd/src/main.cr:72:1 in '__crystal_main'
  from /usr/lib/crystal/crystal/main.cr:97:5 in 'main_user_code'
  from /usr/lib/crystal/crystal/main.cr:86:7 in 'main'
  from /usr/lib/crystal/crystal/main.cr:106:3 in 'main'
  from __libc_start_main
  from _start
  from ???
Lukc commented 5 years ago

An immediate workaround is to remove authd’s main IPC socket:

rm /run/ipc/authd-0-0

A proper fix will be to remove that file automatically on exit, which is currently not always done.

This also shows that errors management is improper at the moment: the error should be reported as another authd service already existing or as authd unable to create its main socket thing.