Error: Wildfly dead but pid file exists - linux

When I tried to restart wildfly webserver it kept giving these errors
Stopping wildfly: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
/etc/init.d/wildfly: line 142: [: -eq: unary operator expected
/etc/init.d/wildfly: line 142: [: -eq: unary operator expected
/etc/init.d/wildfly: line 142: [: -eq: unary operator expected
/etc/init.d/wildfly: line 142: [: -eq: unary operator expected
When I tried to check the status by
sudo service wildfly status
The output is:
wildfly dead but pid file exists
seems like I need to delete PID file so that I can restart it.

I had to delete the /run/wildfly/wildfly.pid and start the service again. For me this was because the system crashed.

Related

Nano Pi R2S Status LEDS Configuration

I have a Nano Pi R2S on Ubuntu 20.04 and I am trying to configure the WAN and LAN led of the unit. Please excuse my low skill set. According to the guide (https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R2S#Config_status_LEDs) I need to put the following into a auto run script.
echo netdev > /sys/class/leds/wan_led/trigger
echo eth0 > /sys/class/leds/wan_led/device_name
echo 1 > /sys/class/leds/wan_led/link
echo netdev > /sys/class/leds/lan_led/trigger
echo eth1 > /sys/class/leds/lan_led/device_name
echo 1 > /sys/class/leds/lan_led/link
Here is my ledstatus.sh
#!/bin/bash
echo netdev > /sys/class/leds/wan_led/trigger
echo eth0 > /sys/class/leds/wan_led/device_name
echo 1 > /sys/class/leds/wan_led/link
echo netdev > /sys/class/leds/lan_led/trigger
echo eth1 > /sys/class/leds/lan_led/device_name
echo 1 > /sys/class/leds/lan_led/link
This is my errors.
./statusled.sh: line 3: echo: write error: Invalid argument
./statusled.sh: line 4: /sys/class/leds/wan_led/device_name: Permission denied
./statusled.sh: line 5: /sys/class/leds/wan_led/link: Permission denied
./statusled.sh: line 7: echo: write error: Invalid argument
./statusled.sh: line 8: /sys/class/leds/lan_led/device_name: Permission denied
./statusled.sh: line 9: /sys/class/leds/lan_led/link: Permission denied
Same issue but fixed, invalid argument here is not invalid for echo, but for the file /sys/class/leds/wan_led/trigger.
The trigger needs a specific value, you can run cat /sys/class/leds/wan_led/trigger to see all valid value, as for the output of cat: the [value] is selected, and the others are options,you must echo one of them, or you got "invalid "

Still connect 22 ssh port when using gpinitsystem command of Greenplum withing different ssh port of CentOS7

I want to install Greenplum in CentOS7.9 which is changed default ssh port to 10022. I changed 'gpssh-exkeys' script to add '-p 10022' for all of ssh command and add '-P 10022' for all of scp command. And run it is ok.
Then I changed '/usr/local/greenplum-db/lib/python/gppylib/commands/base.py' script to add '-p 10022' in a ssh command line.
# Escape " for remote execution otherwise it interferes with ssh
cmd.cmdStr = cmd.cmdStr.replace('"', '\\"')
cmd.cmdStr = "ssh -p 10022 -o StrictHostKeyChecking=no -o ServerAliveInterval=60 " \
"{targethost} \"{gphome} {cmdstr}\"".format(targethost=self.targetHost,
gphome=". %s/greenplum_path.sh;" % self.gphome,
cmdstr=cmd.cmdStr)
But I got the error that present still try to connent port 22 when run 'gpinitsystem'.
[gpadmin#mdw ~]$ gpinitsystem -c /home/gpadmin/gpinitsystem_config --locale=zh_CN -h /home/gpadmin/seg_hosts
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /home/gpadmin/gpinitsystem_config
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
.ssh: connect to host sdw1 port 22: Connection refused
.ssh: connect to host sdw2 port 22: Connection refused
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for multi-home array
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 630: ((: REMAINDER=2 % 0: division by 0 (error token is "0")
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 631: ((: MULTIPLE=2 / 0: division by 0 (error token is "0")
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 632: [: -ne: unary operator expected
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 632: [: -eq: unary operator expected
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 640: [: -gt: unary operator expected
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
ssh: connect to host sdw1 port 22: Connection refused
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 704: [: -eq: unary operator expected
ssh: connect to host mdw port 22: Connection refused
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 732: [: -lt: unary operator expected
ssh: connect to host mdw port 22: Connection refused
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[WARN]:-Postgres version does not match. [postgres (Greenplum Database) 6.19.3 build commit:33e10eef63ae25aeb33afbefdda46b6367353800 Open Source != ]
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-Postgres version does not match Script Exiting!
And I didn't find official documents, https://docs.greenplum.org/, for guiding how to install withing the different ssh port.
Thank you!
Do not modify delivered utilities. Recommend leveraging ~gpadmin/.ssh/config specifying Port for your hosts. All Greenplum utilities should honor settings in that file.
Example ~gpadmin/.ssh/config where all hosts are known as sdw1-pri, sdw2-pri and so on:
Host sdw*-pri
Port 10022
Can you specify the 10022 port in /etc/sshd_config and try again.
gpinitsystem internally calling REMOTE_EXECUTE_AND_GET_OUTPUT function which is part of <install_dir>/bin/lib/gp_bash_functions.sh file.
Currently gp_bash_functions.sh has below entries.
SSH=`findCmdInPath ssh`
if [ x"$TRUSTED_SHELL" = x"" ]; then TRUSTED_SHELL="$SSH"; fi
I think you may need to change the if condition like below
if [ x"$TRUSTED_SHELL" = x"" ]; then TRUSTED_SHELL="$SSH -p 10022"; fi
Thank you Greg Spiegelberg. Show my ~gpadmin/.ssh/config:
Host mdw
HostName mdw
Port 10022
Host smdw
HostName smdw
Port 10022
Host sdw1
HostName sdw1
Port 10022
Host sdw2
HostName sdw2
Port 10022
Priority of ssh config: specified parameter for command > .ssh/config > /etc/ssh/ssh_config

How do i fix bash error - /dev/tty No such device or address

As the question specifics ,i am getting this error while executing my bash script
In exact terms i get following error
bash: line 26: /dev/tty: No such device or address
bash: line 29: /dev/tty: No such device or address
Here are the concerned Line 26 and 29 in script respectively which causes the issue
read -e -p "Paste the links : " links </dev/tty
read -e -p "Enter your input : " sub </dev/tty
If someone wonders, i cannot simply remove writing to </dev/tty from line 26 and 29 , it causes different issues .. So basically i need fix or get alternative for writing to /dev/tty
I am executing my script by running -
curl raw_link | bash
Preferably i want a solution which only requires me to my edit my existing script .i don't want to run the script after saving it locally or execute it using any other way apart from curl raw_link | bash
ls -l /dev/tty returns the following
crw-rw-rw- 1 root root 5, 0 Aug 8 09:28 /dev/tty
ls -l </dev/tty returns the following
/bin/bash: /dev/tty: No such device or address
Also i would like to mention that this issue doesn't seem to be happening on every machine , i intend to use this script on Google Colab where i definitely do get this issue
To fix the bash error, you can try this workaround :
tty=$(readlink /proc/$$/fd/2)
read ... < $tty
$tty contains the actual tty device name.

etc/init.d/vncserver: line 33: [: =: unary operator expected

While starting and stopping the vncserver . i am facing the following error.But, the service is running fine.SO do any one have the similar kind of error on vnc server startup script.
"
/etc/init.d/vncserver restart
Shutting down VNC server: 9:shashikanth.bussa
/etc/init.d/vncserver: line 33: [: =: unary operator expected
start() {
[ "$EUID" != "0" ] && exit 4
# Source networking configuration.
. /etc/sysconfig/network
"
Its because of /etc/sysconfig/network file entry.
We need to make sure the option NETWORKING=yes.
Then restart the vnc service.

installing trousers for tpm emulator

I have installed tpm emulator successfully. I get this error
* Starting Trusted Computing daemon tcsd /etc/init.d/trousers: 32: [: /dev/tpm: unexpected operator [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--configure):
subprocess installed post-installation script returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code (1)
when executing
sudo apt-get install tpm-tools libtspi-dev
The answer to that particular error message is a broken line in the given script /etc/init.d/trousers.
The offending line 32:
31:
32: if [ ! -e /dev/tpm* ]
33: then
gets expanded to:
if [ ! -e /dev/tpm /dev/tpm0 ]
Which provokes an error. Changing that line to something like:
31:
32: if [ ! -e /dev/tpm ] && [ ! -e /dev/tpm0 ]
33: then
should at least make the script work.

Resources