UNIX domain protocol (local communication protocol)

Overview The Unix domain protocols are not an actual protocol suite, but a way of performing client/service communication on a single host. It is a method of inter-process communication (IPC). It provides two types of sockets: byte stream socket SOCK_STREAM (somewhat like TCP) and datagram socket SOCK_DGRAM (somewhat like UDP) The UNIX domain datagram service […]

supervisorProblem handling unix:///var/run/supervisor/supervisor.sock no such file

Problem description Recently, the author encountered some problems when configuring supervisor and hoping to use supervisor for process service management, specifically: When running supervisorctl status, I encountered the problem of unix:///var/run/supervisor/supervisor.sock no such file. I encountered the following error when running sudo service supervisor status sudo service supervisor status ● supervisor.service – Supervisor process control […]

MIT6.S081Lab1: Xv6 and Unix utilities

MIT6.S081 Lab1: Xv6 and Unix utilities Official documentation 一.Boot xv6 How to successfully boot xv6 can be seen in the previous article MIT6.S081 Experimental Environment Construction, there is just one more step, execute it in the clone folder git checkout util Just switch to the util branch. 二.sleep Write a program in user/sleep.c to complete […]

Lab 1: Summary of Unix utilities

This experiment mainly learned some commonly used system calls. Lab 1: Unix utilities Boot xv6 (easy) git clone, switch branches, qemu. Just proceed as required. $ git clone git://g.csail.mit.edu/xv6-labs-2020 $ cd xv6-labs-2020 $ git checkout util $ makeqemu sleep (easy) #include “kernel/types.h” #include “kernel/stat.h” #include “user/user.h” int main(int argc,char *argv[]) { if(argc < 2) { […]

MIT6.S081 Lab1 Xv6 and Unix utilities (updated)

Domestic OS courses may only teach you the concepts of operating systems on the surface. It is like playing a simulator game and just watching others play. After all, you will still lose your way in the world of OS. This article was originally published on my personal blog MIT6.S081 lab1 Q1.sleep (easy) Implement the […]

Comparison of data writing speeds between AF_UNIX and 127.0.0.1 (AF_INET) loopback addresses

Under Linux, there is a situation where local inter-process communication occurs, and one of them is the server and the others are clients. This can be done by binding the port on the server and sending the client to the corresponding port of 127.0.0.1. However, this will waste a port and easily cause security risks. […]

An example of UNIX domain user datagram socket

Service-Terminal: 1: #include <stdio.h> 2: #include <stdlib.h> 3: #include <strings.h> 4: #include <sys/un.h> 5: #include <string.h> 6: #include <sys/socket.h> 7: #include <netinet/in.h> 8: #include <arpa/inet.h> 9: #include <unistd.h> 10: 11: typedef struct sockaddr SA; 12: 13: #define N 256 14: 15: int main(int argc, char *argv[]) 16: {<!– –> 17: 18: int listenfd; 19: struct […]