Skip to content

Commit fd691e6

Browse files
committed
Adding runit service
1 parent 69fdb93 commit fd691e6

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

LaTeX/articleheader.tex

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
\usepackage{hyperref}
1616
\usepackage[margin=1in]{geometry}
1717
\usepackage{listings}
18+
\usepackage{color}
19+
\usepackage{xcolor}
1820
\renewcommand{\baselinestretch}{1.5}
1921
\author{Matheus Augusto da Silva}
2022
\date{\today}
@@ -27,6 +29,20 @@
2729
pdfcreator={Emacs 26.2 (Org mode 9.1.14)},
2830
pdflang={English}}
2931

32+
\definecolor{mygreen}{rgb}{0,0.6,0}
33+
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
34+
\definecolor{mymauve}{rgb}{0.58,0,0.82}
35+
36+
\lstset{ %
37+
backgroundcolor=\color{white}, % choose the background color
38+
basicstyle=\footnotesize, % size of fonts used for the code
39+
breaklines=true, % automatic line breaking only at whitespace
40+
captionpos=b, % sets the caption-position to bottom
41+
commentstyle=\color{mygreen}, % comment style
42+
keywordstyle=\color{blue}, % keyword style
43+
stringstyle=\color{mymauve}, % string literal style
44+
}
45+
3046
%%% Local Variables:
3147
%%% mode: latex
3248
%%% TeX-master: t

README.org

+33-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,37 @@ look like this:
2323

2424
;; Change to the path where you cloned the config to
2525
(org-babel-load-file "/home/trajanus/.emacs.d/myinit.org")
26-
2726
#+END_SRC
27+
28+
* Emacs runit service
29+
If you are on a Linux distribution which uses runit, you can also use
30+
my runit service for running Emacs in server mode.
31+
32+
Before doing so, you should change the owner of the emacs service by
33+
changing "trajanus" to the name of your user on the run scripts at
34+
sv/emacs/ and sv/emacs/log/. Notice you can also change the path
35+
inside the script sv/emacs/log/run to move your server logs to
36+
another directory.
37+
38+
Once that is done, you can enable the service by symlinking the
39+
folder sv/emacs to your /var/service/ directory.
40+
41+
#+BEGIN_SRC bash
42+
ln -s ${PWD}/sv/emacs /var/service
43+
#+END_SRC
44+
45+
The logging allows you to troubleshoot if you find any issues, so do
46+
leave it enabled if you are setting it up for the first time. Once
47+
that is done, you can add something like this to your rc.local file:
48+
49+
#+BEGIN_SRC bash
50+
export EDITOR="emacsclient -nc"
51+
#+END_SRC
52+
53+
To use the graphical emacs client as your default editor,
54+
it may be necessary to also run the command:
55+
56+
#+BEGIN_SRC bash
57+
xhost +
58+
#+END_SRC
59+

sv/emacs/log/run

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec chpst -u trajanus svlogd -tt /opt/logs/emacs

sv/emacs/run

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec chpst -u trajanus emacs -u trajanus --fg-daemon 2>&1

0 commit comments

Comments
 (0)