i35Ao

                    Recently i was surprised to find
                    that Internet doesn't fit into the
                    annex part of my text note, so it's
                    a wrong method to defeat entropy:)

                    inspired by:
                    Frank Zappa, One size fits all, 1975

PROCESSES
---------

A process refers to a program in execution; it’s a running instance of a program*.

------
All You Need To Know About Processes in Linux
by Aaron Kili
Published: March 31, 2017
*) https://www.tecmint.com/linux-process-management/
------

Foreground: ./neverendingstory (^z jobs fg +1)
Background (&, bg -- to run suspended command in the background)
Daemons (services)

  fg, bg, jobs, ^z
  init
  fork() exec()
  Parent and Child processes
  PID, PPID, $$ *1
  ps, top, nice
  kill, killall, signals (^c ^d ^z -9)

------
*1) Unix / Linux - Special Variables
    https://www.tutorialspoint.com/unix/unix-special-variables.htm
------

DAEMONS

systemd:

  systemctl enable sshd.service
  systemctl disable sshd.service
  systemctl start sshd.service
  systemctl restart sshd.service
  systemctl stop sshd.service
  systemctl status sshd.service

  service sshd start
  service sshd restart
  service sshd stop
  service sshd status

  /etc/initd/sshd start
  /etc/initd/sshd restart
  /etc/initd/sshd stop

FreeBSD:

  /etc/rc.conf

  /etc/rc.d/inetd start
  /etc/rc.d/inetd restart
  /etc/rc.d/inetd stop

  /usr/local/etc/rc.d/isc-dhcpd start
  /usr/local/etc/rc.d/isc-dhcpd restart
  /usr/local/etc/rc.d/isc-dhcpd stop

'service' command works as in older Debian.

Annex A. Playing with never ending process
..........................................

Use the write system call (pass on W10 ps or cmd as well):

  $ cat p.c
  void pc(char c) {
    long write(int, const char *, unsigned long);
    (void) write(1, &c, 1);
  }

  int main() {
    pc('H'); pc('I'); pc('\n');
    return 0;
  }
  $ gcc p.c -o p
  $ ./p
  HI
  $

1. How do I write a character to standard output in C
   without using stdio.h or any other library header files?

     https://stackoverflow.com/questions/14296235
     /how-do-i-write-a-character-to-standard-output-in-c-
     without-using-stdio-h-or-any