Amazon Linux; gcc: command not found - linux

I am running Amazon Linux(redhat OS) in EC2.
When I try to rpmbuild a tar I got stuck with this one
checking for x86_64-redhat-linux-gcc... no
checking for gcc... no
checking for x86_64-redhat-linux-cc... no
checking for cc... no
checking for x86_64-redhat-linux-cl.exe... no
checking for cl.exe... no
configure: error: in `/home/falko/rpm/BUILD/courier-unicode-1.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
error: Bad exit status from /var/tmp/rpm-tmp.RkeUmM (%prep)
when I try to check the ff:
$ rpm -q gcc
gcc-4.8.2-3.19.amzn1.noarch
And
$ gcc -v
-bash: gcc: command not found
And
# which gcc
/usr/bin/which: no gcc in (/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin)
I even tried to install it again
# yum install gcc
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
Package gcc-4.8.2-3.19.amzn1.noarch already installed and latest version
Nothing to do
And even remove and reinstall it, I had tried. No luck for me. Can someone please help me about this one I am just trying to install a mail server.
$ sudo find / -name gcc -exec stat "{}" ";"
File: ‘/usr/include/boost/mpl/aux_/preprocessed/gcc’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: ca01h/51713d Inode: 33142 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2014-03-08 00:09:16.000000000 +0000
Modify: 2014-08-01 10:17:15.793438394 +0000
Change: 2014-08-01 10:17:15.793438394 +0000
Birth: -
File: ‘/usr/lib/gcc’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: ca01h/51713d Inode: 18082 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2014-03-25 01:30:05.000000000 +0000
Modify: 2014-03-25 01:30:05.000000000 +0000
Change: 2014-07-24 00:39:05.646351830 +0000
Birth: -
File: ‘/usr/libexec/gcc’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: ca01h/51713d Inode: 18392 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2014-03-25 01:30:05.000000000 +0000
Modify: 2014-07-24 00:39:02.206416684 +0000
Change: 2014-07-24 00:39:02.206416684 +0000
Birth: -

Related

Filesystem stats not available after CIFS reconnect

I am using a Windows Server 2019 with SMBServer Shares which get mounted on a SLES via CIFS.
When Windows does its periodic system cleanup (closing idle SMBServer sessions) the Linux server reconnects with following Kernel message:
CIFS: VFS: \\filer.example.com has not responded in 180 seconds. Reconnecting...
The reconnect seems to be successful, as reading and writing files to the mount is possible.
But querying disk stats is not possible anymore.
Bad file descriptor on df:
user#suse:~$ df -h
df: /mnt/test: Bad file descriptor
Filesystem Size Used Avail Use% Mounted on
...
Wrong data on stat:
user#suse:~$ stat /mnt/test
File: /mnt/test
Size: 0 Blocks: 0 IO Block: 1048576 directory
Device: 38h/56d Inode: 281474976710700 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 1100/ application-user) Gid: ( 80/ application-group)
Access: 2023-02-15 11:04:55.977807600 +0100
Modify: 2023-02-15 11:04:55.977807600 +0100
Change: 2023-02-16 09:50:07.638662000 +0100
Birth: 2023-02-10 14:07:14.408836200 +0100
I noticed the same problem when mounting subdirectories of a single share multiple times. The SLES does mount multiple shares, but each share only once.

Running nginx as non-root in Docker container gives permission denied error

I have the following Dockerfile
FROM ubuntu:14.04
EXPOSE 8000
# Install nginx
RUN apt-get update -q \
&& apt-get install --no-install-recommends --no-install-suggests -y -q \
nginx \
&& rm -rf /var/lib/apt/lists/*
COPY ./nginx.conf /etc/nginx/
COPY ./index.html /usr/share/nginx/test/
RUN groupadd -r webgroup \
&& useradd -r -m -g webgroup webuser \
&& touch /run/nginx.pid \
&& chown -R webuser:webgroup /var/log/nginx /var/lib/nginx /run/nginx.pid
USER webuser
CMD nginx
When I run it I get Permission denied on /var/log/nginx:
mikhails-mbp:test-docker-nginx mkuleshov$ docker run -p 8000:8000 mytest
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/10/02 17:02:51 [emerg] 5#0: open() "/var/log/nginx/access.log" failed (13: Permission denied)
If I get into the container with bash I see:
webuser#d190146a0e8d:/var/log/nginx$ ls -la
total 8
drwxr-x--- 2 webuser webgroup 4096 Jun 2 15:16 .
drwxrwxr-x 8 root syslog 4096 Oct 2 17:02 ..
How is it possible? During the above session I also cannot create files under that user.
Thing that helped: Removing the /var/log/nginx and recreating it again. But I have no idea why this happens.
There is no SELinux.
Has anyone encountered anything like that or is there anything I'm doing wrong?
P.S. Here is docker info if it can help
mikhails-mbp:test-docker-nginx mkuleshov$ docker info
Containers: 179
Running: 0
Paused: 0
Stopped: 179
Images: 901
Server Version: 1.11.2
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 1109
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.4.12-boot2docker
Operating System: Boot2Docker 1.11.2 (TCL 7.1); HEAD : a6645c3 - Wed Jun 1 22:59:51 UTC 2016
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.955 GiB
Name: default
ID: 3K5S:3QBN:BXGY:FASS:VG6P:D4CS:UXRK:GYXB:HJQG:SIQH:F6KQ:N4BN
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug mode (client): false
Debug mode (server): true
File Descriptors: 15
Goroutines: 32
System Time: 2016-10-02T17:08:51.355144074Z
EventsListeners: 0
Username: mkuleshov
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
P.P.S. Here is a test repo with configs for that case: https://github.com/aides/test-docker-nginx
Most likely adding your user into adm group will solve your issue.
Try sudo usermod -aG adm webuser
More details: https://askubuntu.com/questions/421684/cant-access-apache-error-logs

Selenium 2.45 with Firefox 35.0.1 not working in production only

I am using Selenium 2.45 with Firefox 35.0.1 headless browser. Things are fine in dev and test environment, but in production, I am getting error.
Driver info: driver.version: FirefoxDriver
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
Xlib: extension "RANDR" missing on display ":1".
process 20275: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Xlib: extension "RANDR" missing on display ":1".
process 20300: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'prod', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.1.2.0.1.el6.x86_64', java.version: '1.7.0_65'
Production Environment:
1) Downloaded firefox-35.0.1
[prod#prod ~]$ ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
2) soft linked to /usr/bin/firefox
[prod#prod ~]$ ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 Jun 11 15:59 /usr/bin/firefox -> /usr/local/firefox/firefox
[prod#prod ~]$
3) Ran Xvfb
[prod#prod ~]$ ps ax |grep Xvfb
15425 ? S 0:00 sudo Xvfb +extension RANDR :1 -screen 0 1024x768x24
15426 ? S 0:00 Xvfb +extension RANDR :1 -screen 0 1024x768x24
23102 pts/6 S+ 0:00 grep Xvfb
Test Environment:
[root#vc-stage ~]# ll /usr/bin/firefox
lrwxrwxrwx 1 root root 26 May 24 21:32 /usr/bin/firefox -> /usr/local/firefox/firefox
[root#stage ~]#
[root#stage ~]# ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
[root#stage ~]#
[root#stage ~]# ps ax | grep Xvfb
3899 pts/5 S+ 0:00 grep Xvfb
27393 ? S 0:01 Xvfb +extension RANDR :1 -screen 0 1024x768x24
[root#stage ~]#
The only difference between test and prod is; in test I am running everything from a root user. In prod, I am running by a sudo user.
Update: The error message is gone without any changes whatsoever, Duh. Now, it is simply not creating the firefox Driver.
Everything was all right. 1 package was missing in production- "dbus". After installing and configuring the package, everything worked fine.

phpmyadmin, neginx error.log - Check group www-data has read access and open_basedir

I have this message on phpmyadmin website
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
On the 'click here' page I have this:
Page printscreen
My nginx error are:
2014/06/27 15:08:15 [error] 4922#0: *886 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.2014/06/27 15:17:07 [error] 5119#0: *939 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions" while reading response header from upstream, client: 1***, server: _, request: "GET /phpmyadmin/js/messages.php?lang=en&db=&token=**** HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/ispconfig.sock:", host: "****:8080", referrer: "https://****:8080/phpmyadmin/chk_rel.php?db=&table=&server=1&target=&token=****"
I give them permissions with this cmd for all 3 files:
chgrp www-data /var/lib/phpmyadmin/blowfish_secret.inc.php
chmod 644 /var/lib/phpmyadmin/blowfish_secret.inc.php
How to fix the open_basedir restrictions?
I checked Google but didn't find anything. Please give me some help or tips how to fix it. Thank you!
Ubuntu version:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
Here's my configuration:
drwxr-xr-x 3 root root 4096 feb 14 10:05 phpmyadmin/
that's for folder. And for those two files:
-rw-r----- 1 root www-data 60 feb 14 10:05 blowfish_secret.inc.php
-rw-r----- 1 root www-data 0 feb 14 10:05 config.inc.php
Hope this will help. Also check for php5-mcrypt extension. If it's not working properly, use
sudo php5enmod mcrypt
to install it, and then just restart ngnix. here are commands:
chmod 755 /var/lib/phpmyadmin
chmod 664 /var/lib/blowfish_secret.inc.php
chmod 664 /var/lib/config.inc.php
those commands should work. :)

Sudo permission issues

When running sudo make install I run into permission issues. This makes no sense to me as I would expect sudo to have permission to do anything.
Example of sudo vs non sudo execution:
This is also used by node.js make but I ran it separately.
[tydup13#kirk node]$ stat /home/tydup13/git/node/out/Release/obj.target/deps/cares/libcares.a
File: ‘/home/tydup13/git/node/out/Release/obj.target/deps/cares/libcares.a’
Size: 740904 Blocks: 1448 IO Block: 1048576 regular file
Device: 27h/39d Inode: 116264377 Links: 2
Access: (0664/-rw-rw-r--) Uid: (13993/ tydup13) Gid: (13993/ tydup13)
Context: system_u:object_r:nfs_t:s0
Access: 2014-01-30 15:31:52.473071581 -0700
Modify: 2014-01-30 15:29:08.425186992 -0700
Change: 2014-01-30 15:29:08.567191219 -0700
Birth: -
[tydup13#kirk node]$ sudo stat /home/tydup13/git/node/out/Release/obj.target/deps/cares/libcares.a
stat: cannot stat ‘/home/tydup13/git/node/out/Release/obj.target/deps/cares/libcares.a’: Permission denied
I discovered that sudo was squashed on the computer I was using and doesn't allow sudo to cross user boundaries for security. Useful and annoying at the same time.

Resources