Skip to content

Commit 69468c3

Browse files
committed
adding nohup and disown to the relevant lecture
1 parent b34749e commit 69468c3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

lecture07/lecture07.pdf

3.63 KB
Binary file not shown.

lecture07/lecture07.xetex

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,33 @@
450450
\end{minted}
451451
\end{leftemize}
452452
\end{frame}
453+
454+
\begin{frame}[fragile]{Detaching Jobs}
455+
\vspace*{-0.5ex}
456+
\alert<1>{When you launch jobs with an \texttt{\&} and then close your terminal, those jobs will \emph{end}.}
457+
\vspace*{-0.5ex}
458+
\begin{block}{\colbf{No H}ang\colbf{up}}
459+
\texttt{nohup <command> [args]}
460+
\begin{enumerate}[\--]
461+
\item Launches \texttt{command} so it will not end with \texttt{SIGHUP} signals.
462+
\item E.g. {\footnotesize\texttt{nohup vlc best\_song\_ever.flac > /dev/null 2>\&1 \&}}
463+
\begin{enumerate}[\--]
464+
\item Now we do not lose \texttt{vlc} when we close our terminal.
465+
\end{enumerate}
466+
\end{enumerate}
467+
\end{block}
468+
\vspace*{-1ex}
469+
\pause
470+
\alert<2>{If you have already launched the job, you can still save it.}
471+
\begin{block}{\colbf{Disown} a Job}
472+
\texttt{disown [flags] jobspec}
473+
\begin{enumerate}[\--]
474+
\item The \texttt{-h} flag prevents \texttt{jobspec} from \texttt{SIGHUP} killing it.
475+
\item The \texttt{jobspec} is the job number (e.g. run \texttt{jobs}).
476+
\item E.g. if \texttt{jobID} 1 is \texttt{vlc}, then \texttt{disown -h \%1} will work.
477+
\end{enumerate}
478+
\end{block}
479+
\end{frame}
453480
%%%%%
454481
%%%%%
455482
%%%%%

0 commit comments

Comments
 (0)