Questions tagged [unix]
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.
1,957
questions
0
votes
1
answer
27
views
argument to pgrep from cmdline returns 2 PID's and argument from global variable value returns 1 PID
1.first case(processName as argument from cmd i.e java)
command from cmd with arguments : ./a.sh getProcessId contains java
code:
getProcessId(){
matchType=$1
#defaulting matchArg to x i.e exact ...
0
votes
1
answer
124
views
pgrep -f from shell script is returning 2 pid instead of 1
code :
function main {
[ -z "$@" ] && { getProcessId "$@" } || "$@"
}
getProcessId(){
matchType=$1
#defaulting matchArg to x i.e exact match
matchArg=x
...
0
votes
2
answers
98
views
change shell to /usr/bin/false in IBM aix os
I would define the program run for the user at session initiation into /usr/bin/false in /etc/passwd. The default value parameter is /usr/bin/ksh.
When I try to modify it with commands:
bash-5.1# ...
0
votes
1
answer
150
views
kubectl get nodes --kubeconfig admin.kubeconfig returns "No resources found"
I am a newbie in Kubernetes. I am not even very familiar with basic kubernetes commands, but the installation is a starting point for my learning journey. I wanted to avoid installing something like ...
0
votes
0
answers
59
views
not able to send mail with attachment from linux ubuntu : 20.04 by using email mailutils (sendmail keyword)
code :
subject="Service resilience service status"
body="Service is down"
from="[email protected]"
to="[email protected]"
attachment="/home/ubuntu/...
-2
votes
1
answer
57
views
Is it bad that I don't update the server? [closed]
I am running an application on my server with the help of Nodejs, and it has many dependencies such as Chrome.
I have not updated my server for two years. I am afraid that if I do, my code will fail ...
0
votes
0
answers
25
views
Need help in logrotation
I have custom logrotation as below..
cat /etc/logrotate.d/apache
#
#
/var/log/apache/apache.log
{
daily
rotate 30
size 1G
compress
missingok
...
1
vote
1
answer
143
views
nginx fowarding 20% (spaces) instead of + in url
I have an NGINX config that takes url's converts them with regular expression, this works fine. The issue is that while forwarding to the new atlassian instance the + from the URL is turned into %20 ...
0
votes
1
answer
219
views
is /etc/sudoers writable or not
The default permission in /etc/sudoers file is readonly for root and group root as in picture is obvious :
So when you open it with any test editor it can't be written and give error read only.
now ...
1
vote
0
answers
101
views
Mount a remote GPU locally on Rocky Linux
I am doing some work on a server which has 1TB RAM, 100CPUs, and 1000TB storage. My work involves very large datasets.
One specific I am trying to run would benefit immensely from a GPU, it is ML ...
1
vote
3
answers
640
views
How to have an environment variable with quotes in crontab?
I have a minimum example of my problem, which is trying to install a crontab that looks like this:
FOO="foo\"bar\"bin"
0 0 1 * * ls
by running crontab crontab (I have it in a ...
0
votes
1
answer
239
views
Passing a user input to an ssh command
I'm currently trying to create a shell script that will execute a mysqldump on a remote mysql database and then copy the output file back to my local machine. The problem I'm running into is that I ...
0
votes
0
answers
102
views
Apache 2.4 unixgroup authentication not working
Require unix-group is not working for me when configuring the VirtualHost for my Apache server. Whenever I log in using pwauth, the server still authenticates users who are not members of the group ...
0
votes
1
answer
840
views
Send STDERR to console and file, STDOUT to file only
I have some script with STDOUT and STDERR output. By default, both STDOUT and STDERR goes to console:
./script.sh
I can redirect STDOUT to file, leaving STDERR output in console:
./script.sh > log....
0
votes
0
answers
74
views
How to Find which Program is generating given .dat File
I have a file in a folder on the server with ".dat" extension. I want to find which program file is generating this file.
How should I find this using putty?
0
votes
0
answers
88
views
Linux Debian ACL, is default mask overriden by something in FTP?
I have an Linux Debain 10 server running an web project.
The project (parent) folder is as follows:
ls -la:
drwxrwxr--+ 7 some_user some_group 4096 Jul 21 11:01 .
getfacl:
# file: .
# owner: ...
0
votes
1
answer
331
views
sed not working on large files. Any other options available?
Trying to insert a line feed on large files in UNIX when a text string matches. Any file around 1GB or less, it works. Anything over that size, it does not complete the replace. It appears to do ...
0
votes
0
answers
151
views
Add mac address in rsyslog template
I am trying to add system/device mac address in syslog. No solution is working for me. Following command gives me mac address, just wanted to use in rsyslog template.
mac_addr=$(ifconfig en0 | awk '/...
0
votes
0
answers
40
views
Cant ssh to ec2 created from AMI of recently patched server
One of my ec2 instance "patched-server-1" was running of kernel version 4.18.0-240.1.1.el8_3.x86_64 and then I did patched the server and current kernel version is 4.18.0-425.19.2.el8_7....
0
votes
0
answers
247
views
ldap+sssd on SuSE shows only local users
Problem: Not able to list ldap users.
Hello,
I am setting up new LDAP authentication on our SuSE 12 test system. I am a LDAP newbie and following the instructions from the site https://www.port389.org/...
0
votes
0
answers
958
views
Can't enable the PHP DOM extension
I have a server that has PHP 7.4.3 installed, but it doesn't load PHP-DOM.
It's not listed in php -m or php -i, nor when I load PHP on a page.
Here's what I tried so far:
Ran sudo apt-get install php-...
0
votes
1
answer
45
views
How to protect Jenkins from super users?
Any super user who has access to the Jenkins running on a Linux server can easily disable security authentication from config.xml file; then log in and can also decrypt sensitive passwords from ...
1
vote
1
answer
624
views
'mail' not working in Script same way it is working from command line
The below line of code/command is working as expected if I run it from Unix terminal, but not if I include it in a script and run the script - exact same.
I am expecting the X-Priority to show the ...
0
votes
0
answers
140
views
How do you get resize2fs to actually fit to your filesystem?
Using Ubuntu Mint here, 20.1 Cinnamon.
I'm trying to reduce a SD partition as much as possible, but when use resize2fs
sudo e2fsck -f /dev/sdb2
sudo resize2fs -M /dev/sdb2
it resizes the partition to ...
0
votes
2
answers
363
views
Adding users to Unix groups only if said groups exist (puppet)
I tried using the 'group' attribute of the 'user' resource like so :
user {
"user":
group => ["docker", "www-data"]
}
If the groups 'docker' and 'www-data' exist ...
-2
votes
1
answer
158
views
transfer file from Unix to a writeable Windows share, if I don't have direct login rights to the latter
I'm an sa on Unix side, and there is a writeable Windows share, which I can access from my desktop using an AD service account.
How can I batch a file transfer from Unix over to that mount (it's not ...
0
votes
1
answer
85
views
Way to know the current shell in a given terminal
I have a shell on a Unix system.
Is there a command that can tell me which shell I am working ? (bash, zsh, etc. )
-1
votes
1
answer
48
views
Linux analyze and monitoring log tool?
I have a server using OS centos-7, but sometimes my server got slow with some processes. I want to check which service or process makes the system slow. how to check the percentage of CPU, ram, or ...
0
votes
0
answers
258
views
Failed to connect to remote MySQL server via proxy
I am trying to use an R tool in which RMySQL is one of the package being used. I am working this on ubuntu behind a corporate proxy but having the following issue for three days persistently.
Error ...
1
vote
1
answer
1k
views
Does information piped through a Unix socket touch disk?
I'm trying to understand how fast different IPC mechanisms are, and I know it's possible to create a Unix Socket as a "file" in a directory on a filesystem, but what I don't understand is ...
2
votes
0
answers
376
views
Is there a utility for detecting temporary system freezes?
Is there a (unix) utility which is able to detect temporary system freezes by observation?
E.g. I could imagine an utility which continuously fetches the system time, sleeps for a specific amount of ...
0
votes
1
answer
39
views
Single SSH login for multilpe machines?
I have a number of physical (desktop) machines running at the office as part of a new network to handle processing & serving Open Source data; some of these machines also house VMs.
At the moment, ...
0
votes
1
answer
275
views
Geting UNIX Timestamp while logging history
I am running below bash script which is saving the history in a file, however it is logging the history with Unix epoch timestamp. I need the timestamp in human readable format.
_who_am_i=$(who am i|...
1
vote
1
answer
1k
views
Why some companies like cisco follow different syslog messaging format rather than rfc 3164 (BSD syslog) and rfc 5424 (IETF syslog)?
According to my understanding the popular syslog formats are:
RFC 3124 (BSD syslog):
Format: < priority >timestamp hostname application: message
Example: <133>Feb 25 14:09:07 webserver ...
-2
votes
1
answer
390
views
Why an operating system would like to be POSIX compliant? [closed]
What's the big deal around POSIX and how it interferes in the overall usage of an Operating System?
0
votes
1
answer
454
views
Nginx reverse proxy when port is already in use?
i am trying to close port with basic authentication (for pushgateway of prometheus), so not a big specialist in nginx, so could someone please give me and advice where i am is wrong?
I have 9091 port, ...
0
votes
2
answers
144
views
Issue using dd to write 1GB file to zfs dataset on FreeBSD 13
Hey guys I am turning up a little FAMP stack on an Azure VM. 4 Xeon cores 16GB ram. Second SSD is using ZFS and the boot drive is UFS2 (Default). When I dd if=/dev/zero of=testfile bs=1024 count=...
1
vote
0
answers
1k
views
Replace a string from the cat output
I need to replace a string with the string which is mentioned in a file abcd.txt in all files in a folder.
For eg: I want to replace a string 'apple' with whatever the cat output of this file abcd.txt
...
1
vote
0
answers
805
views
Copying files from remote to local using lftp in unix
I'm trying to write a script to copy some files from a remote ftp server to a local directory. I have seen lots of examples using the mirror command of lftp but so far none of them seem to work. ...
0
votes
0
answers
155
views
NextCloud : Can you use encrypted drives / file level encryption?
I am evaluating NextCloud for a solution for which I have a requirement that files cannot exist on non encrypted disks or the files themselves cannot be individually read or cached.
I have read a lot ...
0
votes
1
answer
449
views
What is the maximum value acceptable for xargs -P argument? [duplicate]
In this answer they mention 10
I did man xargs and couldn't find what's the maximum limit.
Is it possible to send 10000 cURL requests per second?
How about 50000 cURL requests per second? I mean all ...
0
votes
1
answer
246
views
What was linux/unix time standard before inventing epoch? [closed]
As in the title, I was looking for, but hadn't found. How were time stored and processed before epoch standardizing in 2000?
0
votes
2
answers
2k
views
How to edit the middle of host name (%h) in ssh config?
In ssh config you can easily edit a hostname by appending or prepending it with something. For example, when you want to connect to server with ssh test5, but actually the server name is test5.mail, ...
0
votes
0
answers
605
views
change fastcgi directory in nginx configuration
i am not sure how to write the proper title
i have 5 ajax requests that gonna execute postgresql query in php
here is the directory
/var/www/webgis.com:
1. webgis.html
2. php(directory)
-query1....
0
votes
1
answer
372
views
finding docker images with tag and name
when I do docker images I have below docker images as list where there are images with multiple tag and also image with latest tag value.
REPOSITORY TAG ...
0
votes
1
answer
744
views
What is igrid server - port 19000?
Recently our monitoring tools is reporting a port as down, the port number is 19000.
I have never seen this port before and I don't find out good information. Doing some tests, I've seen I can telnet ...
0
votes
1
answer
503
views
Samba username mapping not working as desired
I have the following username mapping in Samba:
master = johndoe user2 user3
regular = user5 user6
restricted = johndoe user8 user9
By default, Samba will always map johndoe to the last entry in ...
0
votes
0
answers
455
views
lsyncd include specific files exclude rest
I am using lsyncd version 2.2.2. here is my current code.
settings {
logfile = "/etc/lsyncd.log",
statusFile = "/etc/lsyncd.status",
insist = true,
}
sync {
default.rsyncssh, ...
0
votes
2
answers
157
views
Is SSH remote execution more secure as local non-root?
Is there a security benefit running a command remotely via ssh as a local non-root user? In other words, is this actually more dangerous compared to executing the ssh command as non-root:
root@local:~#...
1
vote
0
answers
52
views
How to ensure execution of time consuming task on reboot/shutdown?
I have a bash script that is supposed to execute on reboot/shutdown of a remote Ubuntu server, connected over SSH:
ls /etc/rc{0,6}.d/k99*
/etc/rc0.d/k99_stop_all /etc/rc6.d/k99_stop_all
The script ...