How do you remove configuration settings from debconf - debconf

I've tried this approach mentioned in many places, but it fails with the following error message:
sudo echo PURGE | debconf-communicate mirrorsync
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
0

Related

Solr throwing 'org.apache.commons.exec.ExecuteException' on Start

I am setting up Solr for Centos 7. When i try to execute any sample project for ex. using ./bin/solr start -e techproducts, its throwing error of 'Exception : org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)' . How to fix this. Java is installed under '/usr/bin/java'
I tried with changing Java home directory path
./bin/solr start -e techproducts
*** [WARN] *** Your Max Processes Limit is currently 31165.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Solr home directory /tmp/solr-7.7.2/example/techproducts/solr already exists.
Starting up Solr on port 8983 using command:
"bin/solr" start -p 8983 -s "example/techproducts/solr"
*** [WARN] *** Your Max Processes Limit is currently 31165.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
Please consult the Reference Guide. To override this check, start with argument '-force'
ERROR: Failed to start Solr using command: "bin/solr" start -p 8983 -s "example/techproducts/solr" Exception : org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
Credit for the answer should go to #MatsLindh (see comment above). I'm adding it here for others who may experience the same problem.
The issue is that Solr doesn't want you to run it as a root user - or what it thinks is a root user (I've seen this issue with WSL as well and one isn't running as root).
Using root is a security risk but you can force Solr to start anyways by adding -force to the command, for example:
bin/solr start -e cloud -force

Not able to mount azure file share into local RHEL7 VM

I want to mount(symlink) from Azure file share to a local RHEL7 VM . I am using the following command
mount -t cifs //<storage-account-name>.file.core.windows.net/<share-name> /mymountpoint -o vers=3.0,username=<storage-acc-name>,password=<pwd>,dir_mode=0777,file_mode=0777,sec=ntlmssp,mfsymlinks
but getting the following error
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
`The dmesg | tail gives the following log
[root#googleapps ~]# dmesg | tail
[98383.619149] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
[98383.619151] fs/cifs/smb2misc.c: SMB2 len 77
[98383.619163] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=1 state=4
[98383.619168] Status code returned 0xc0000022 STATUS_ACCESS_DENIED
[98383.619175] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741790 to POSIX err -13
[98383.619177] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[98383.619181] CIFS VFS: Send error in SessSetup = -13
[98383.619185] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 59) rc = -13
[98383.619297] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 58) rc = -13
[98383.619300] CIFS VFS: cifs_mount failed w/return code = -13`
Try removing the Symlink option then manually linking it afterwards. I did a quick test on my machine, a RHEL V7 (Brand new for testing) on Azure, and linked a file share with it using the following steps:
1- Manually create the mount point dir, then run the following:
sudo yum install cifs-utils
sudo mount -t cifs //USERNAME.file.core.windows.net/FILESHARE ~/mountpoint/ -o vers=3.0,username=<>,password=<>,dir_mode=0777,file_mode=0777,sec=ntlmssp
Then try using the symlink afterwards.
I had the similar problem. Read most of the forums tried all in the end found that password used by me was wrong and it has to be SSH key which is generated with storage account. I got hint to this by using trouble shooting script by Azure support.
You can find this script here :
https://gallery.technet.microsoft.com/Troubleshooting-tool-for-02184089
Bash script found here can be used to go through series of probable issues and will give you a fair idea of the problem.
Sometimes you will get Status code returned 0xc0000022 STATUS_ACCESS_DENIED if you do not have the proper "Public network access" setting.
Set this setting to "All networks" or add your Server IP/CIDR to the firewall exclusion list.

Laravel 5.4 - 500 error after install

Yesterday I've installed a fresh CentOS 7 VM with Apache, MySQL and PHP 7.0.17.
After that, I installed composer and all other required php-packages.
Then I followed this guide to install Firefly-iii : https://firefly-iii.github.io/using-installing.html.
So far so good. The database is migrated and seeded from the php artisan migrate command.
Now the problem, when I try to access the application from the browser, a 500 error appears. No log rules, nothing.
Alright, this might be an permissions problem. I have changed the owner to apache:apache, no result. Set the storage and bootstrap/cache folder to 777 no result.
Alright... What now. Ah, maybe the user or usergroup is incorrect. I've copied my public/index.php and built in some try catch statement (still no log).
When I open the application in the browser finally some result is returned.
This try/catch:
try {
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
} catch (Exception $e){
echo $e->getMessage();
echo '<br/>';
echo 'User: '.exec('whoami');
echo '<br/>';
echo 'Group: '.exec('groups');
echo '<br/>';
}
returns the following result:
The stream or file "/var/www/html/application-folder/storage/logs/application-name-2017-04-06.log" could not be opened: failed to open stream: Permission denied
User: apache
Group: apache
After this message I've created the /var/www/html/application-folder/storage/logs/application-name-2017-04-06.log file and changed the permissions to 777.
Here is a little piece of my bash history :
[user#16 logs]$ sudo chmod 777 firefly-iii-2017-04-06.log
[sudo] password for user:
[user#16 logs]$ ls -l
-rwxrwxrwx+ 1 apache apache 5 Apr 6 14:18 firefly-iii-2017-04-06.log
[user#16 logs]$ chmod 777 firefly-iii-2017-04-06.log
chmod: changing permissions of ‘firefly-iii-2017-04-06.log’: Operation not permitted
This error messages is still returning and at this moment I've no idea what else I can try to fix this problem.
Does anyone knows a solution or has anybody else expecting this strange behavior?
Please help me, I am completely stuck at this moment and don't know what to do now and how I can solve this problem.
After a little bit of search yesterday I've found this answer : https://stackoverflow.com/a/37258323/1805919
I've tried it on my own server, and at this moment the application is accessible trough the browser.
Prove this is the problem by turning off selinux with the command
setenforce 0
This should allow writing, but you've turned off added security
server-wide. That's bad. Turn SELinux back
setenforce 1
Then finally use SELinux to allow writing of the file by using this
command
chcon -R -t httpd_sys_rw_content_t storage
And you're off!
First of all your server has to be in owner group of application path.
Second you have to set permissions to storage folder. Here is an example how to set permissions on *nix systems:
sudo chmod -R ug+rwx storage bootstrap/cache
Have you tried setting a new application key? Have you also ran your migrations and created the database for the application?

Centos 6.5, WHM : Rsync with Root disabled using ssh user from the Wheel Group

I'm trying to rsync files with my server, which has root login via ssh disabled. I'm trying to use one of the users I've created and added to to the wheel group. Usually - when I log in via ssh I run
su - root
then type the password and can run everything as root user, but not quite sure how to do it with rsync as I need to upload the files outside of the user directory.
When I run:
rsync -avz files/* sshwheeluser#ip_address:/home/newproject/public_html/
I get:
rsync: ERROR: cannot stat destination "/home/newproject/public_html/": Permission denied (13)
I have added the following to the /etc/sudoers file:
rsyncuser ALL= NOPASSWD:/usr/bin/rsync
plus I've un-commented:
%wheel ALL=(ALL) NOPASSWD: ALL
I've also tried to run the command with –rsync-path="sudo rsync" as suggested in some posts, but still no luck:
rsync -avz –rsync-path="sudo rsync" files/* sshwheeluser#ip_address:/home/newproject/public_html/
Next I tried to use it with additional -e "ssh":
rsync -avz -e "ssh" –rsync-path="sudo rsync" files/* sshwheeluser#ip_address:/home/newproject/public_html/
which changed the error message (looks like we're getting somewhere):
stdin: is not a tty
sudo: sorry, you must have a tty to run sudo
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-40/rsync/io.c(452) [sender=2.6.9]
This post suggests that require_tty and tty_tickets should be disabled in sudoers, but I can't find these options in the /etc/sudoers file.
I've added (as recommended) Defaults !tty_tickets to the sudoers, but still the same message.
Any idea what else I need to do to make it work?
You should check Selinux logs, rsync is probably been blocked by Selinux.
You can also try to run:
semanage permissive -a rsync_t

How to exclude .cpan folder from rsync?

I use rsync to backup the home directory (ext4) of my Ubuntu installation. I use the following command to copy files and folders to a remote server (ext4).
$ rsync -rt --delete --delete-excluded --links \
--exclude-from '/home/jjd/rsync-home-exclude.txt' \
/home/jjd/ server:/volume1/backup-home
I defined some folders and files which can be ignored for the backup:
$ cat /home/jjd/rsync-home-exclude.txt
/home/jjd/.thumbnails/
/home/jjd/Downloads/.org.chromium.Chromium*
/home/jjd/.cpan
.cache/
*.swp
*.lock
*.tmp
/home/jjd/.local/share/recently-used.*
.TrueCrypt/.show-request-queue
.dropbox/command_socket
.dropbox/iface_socket
*.sock%
Nevertheless, rsync still reports the following errors:
rsync: opendir "/home/jjd/.cpan/build/local-lib-1.008009-Xl6GGK/inc" failed: Permission denied (13)
rsync: opendir "/home/jjd/.cpan/build/local-lib-1.008009-Xl6GGK/lib" failed: Permission denied (13)
rsync: opendir "/home/jjd/.cpan/build/local-lib-1.008009-Xl6GGK/t" failed: Permission denied (13)
IO error encountered -- skipping file deletion
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
Just remove /home/jjd from the exclude file. According to the rsync documentation, a leading slash does not apply to the root of the filesystem, but to the "root of the transfer".