Hi guys,
I would like to start emacs as a daemon at boot, using the configuration file of an user named "alex".
Here is my
When the daemon is started at boot, my configuration files is not loaded (instead of Doom emacs, I'm back to default Emacs). If I start the daemon manually with
It seems the daemon cannot access the configuration file during boot. Any ideas ?
Thanks in advance
I would like to start emacs as a daemon at boot, using the configuration file of an user named "alex".
Here is my
rc.d
script, in /usr/local/etc/rc.d/emacsd
Bash:
#!/bin/sh
# PROVIDE: emacsd
# REQUIRE: login # after login
# Emacs daemon
. /etc/rc.subr
name="emacsd"
rcvar=emacsd_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
: ${emacsd_enable:=no}
: ${_msg="Emacs daemon started."}
emacsd_start()
{
su alex -c "env HOME=/home/alex /usr/local/bin/emacs --daemon"
}
emacsd_stop()
{
su alex -c "/usr/local/bin/emacsclient --eval \"(kill-emacs)\""
}
run_rc_command "$1"
When the daemon is started at boot, my configuration files is not loaded (instead of Doom emacs, I'm back to default Emacs). If I start the daemon manually with
service emacsd start
, it works fine.It seems the daemon cannot access the configuration file during boot. Any ideas ?
Thanks in advance