I have a node server running consistently on port 3000,so every time I kill it, it will load back.I know which program server it is, but I don't know which program/service is responsible to restarting the server.I did install docker lately, but I made sure docker & docker-compose are both inactive i.e. stopped.Is there any way to find out what is the responsible program?Update:this is happening on only 1 server \ project.and only happening on "nodemon" but not when I run the server with node filename.js...Read more

linux - Using variable in command path for ExecStart in systemd service

Im trying to make a systemd service like below : [Unit]Description=Syslog[Service]Type=simpleEnvironment="TESTEXTSERVICESFILES=/opt/test/extservices"Environment="TESTCONFDATA=/storage/test/conf"ExecStartPre=/bin/echo ${TESTEXTSERVICESFILES}/syslog/bin/nxlog $TESTCONFDATAExecStart=/opt/test/extservices/syslog/bin/nxlog -c ${TESTCONFDATA}/syslog/nxlog.conf#ExecStart=/${TESTEXTSERVICESFILES}/syslog/bin/nxlog -c ${TESTCONFDATA}/syslog/nxlog.conf[Install]WantedBy=multi-user.targetAfter running 'sudo systemctl daemon-reload ; sudo systemctl start tes...Read more

linux - Trying to run service that access to X server under systemd

I'm using manjaro linux (arch based) with systemd. I want to make a daemon service that runs in the background and takes screenshots of my screen at random intervals, up to 10 minutes apart.I'm using Go, and I have a program that works just fine if I build it and run it from the command line (see below). I've made a .service file (see below) for the service and I've started it with systemctl start screenshot and confirmed it's running with systemctl is-active screenshot. However, it doesn't work. No screenshots are being saved like if I run it ...Read more

linux - Aerospike not starting automatically after system reboot

I am running aerospike and other services , manual setup is working fine and when I tried to add all the other services as systemd services in my Linux environment , as the processes can start soon after reboot. All services are starting up except aerospike. I have followed this documentation and I can only manually start after reboot. What else to be done to make it up soon after reboot ?I have installed aerospike following this documentation.Attached the log screenshot.Command used to check the status after reboot is below : sudo systemctl s...Read more

linux - win32com error when use pyinstaller inside virtual_env

Error occurs when i compile in virtual_env . If compile without virtual_env ,it works. Packages are installed in the same and virtual_env in the general environment.If compile programm "hello world", all works. But if add the package 'twisted' it presented error.pyinstaller - 3.2Python 2.7.12 setuptools 30.2.0Platform: Linux-4.4.0-53-generic-x86_64-with-Ubuntu-16.04-xenialThe project itself requires packagesimport json,ctypes,logging.handlers,os,sqlite3,pyudev,subprocess,sys,threading,time,datetime,multiprocessingfrom twisted.internet import re...Read more

How do I find all files containing specific text on Linux?

I'm trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I'm looking for text within the file, not in the file name.When I was looking up how to do this, I came across this solution twice:find / -type f -exec grep -H 'text-to-find-here' {} \;However, it doesn't work. It seems to display every single file in the system.Is this close to the proper way to do it? If not, how should I? This ability to find text strings in files would be extraordinarily useful for some programming pr...Read more

remote command on windows from linux

I want to run windows command on windows 2003 server from RHEL machine.I tried one way to do it using winexe and it is working as expected. However to do this one I have to keep 139 port open and apparently this is a very vulnerable port and is advised not to be kept open.One other way I found was to use cygwin and open ssh packages but these are again not supported in windows 2003 server.Can anyone please suggest me any other way leaving these 2 to connect linux and windows machine and run command on cmd.exe from linux terminal....Read more

linux - Mt7630e driver build and install on Fedora27

I am newbie in Linux, i've installed Fedora27 and now trying to install wifi driver. I tried to install driver from https://github.com/neurobin/MT7630E and got some errors that might be fixed.Here are the errors while installation: [mrsarayra@Fedora-host MT7630E-release]$ sudo ./install[sudo] password for mrsarayra: make -C /lib/modules/4.13.9-300.fc27.x86_64/build M=/home/mrsarayra/Downloads/MT7630E-release/rt2x00 modulesmake[1]: *** /lib/modules/4.13.9-300.fc27.x86_64/build: No such file or directory. Stop.make: *** [Makefile:9: all] Error 2...Read more

kernel - linux syscall using spinlock returning value to userspace

I'm, currently struggling with the correct implementation of a kernel-spinlock in combination with a return statement which should return a value to userspace. I implemented a kernel syscall 'sys_kernel_entropy_is_recording' which should return the value of a kernel-variable 'is_kernel_entropy_recording': asmlinkage bool sys_kernel_entropy_is_recording(void) { spin_lock(&entropy_analysis_lock); return is_kernel_entropy_recording; spin_unlock(&entropy_analysis_lock); }At this point arise two questions:Q1: Is...Read more

linux - Does userfaultfd now support file backed map?

I saw from the documentation of userfaultfdhttps://manpages.debian.org/testing/manpages-dev/userfaultfd.2.en.htmlhttp://man7.org/linux/man-pages/man2/ioctl_userfaultfd.2.htmlthat userfaultfd will start supporting shared map since kernel 4.11. However, the documentation still looks very ambiguous in the sense that I'm still wondering will these include supporting file-backed mmap (which can also be MAP_SHARED)?...Read more

How to mmap a file inside the linux kernel?

I'm hooking some system calls using kprobes inside the linux kernel. During that, I would like to read from a file using mmap.It's not possible to use system calls inside the kernel, but often there are other ways around it. (e.g. sys_open vs. vfs_read).Is that possible and if so, how?...Read more

linux - Is gettimeofday() guaranteed to be of microsecond resolution?

I am porting a game, that was originally written for the Win32 API, to Linux (well, porting the OS X port of the Win32 port to Linux).I have implemented QueryPerformanceCounter by giving the uSeconds since the process start up: BOOL QueryPerformanceCounter(LARGE_INTEGER* performanceCount){ gettimeofday(&currentTimeVal, NULL); performanceCount->QuadPart = (currentTimeVal.tv_sec - startTimeVal.tv_sec); performanceCount->QuadPart *= (1000 * 1000); performanceCount->QuadPart += (currentTimeVal.tv_usec - startTimeVal.tv_...Read more