sed Archives - Justin Silver https://www.justinsilver.com/tag/sed/ Technology, Travel, and Pictures Tue, 15 Oct 2019 19:19:53 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png sed Archives - Justin Silver https://www.justinsilver.com/tag/sed/ 32 32 Fix pkg on FreeNAS 11.2 https://www.justinsilver.com/random/fix-pkg-on-freenas-11-2/?utm_source=rss&utm_medium=rss&utm_campaign=fix-pkg-on-freenas-11-2 https://www.justinsilver.com/random/fix-pkg-on-freenas-11-2/#comments Mon, 01 Apr 2019 21:53:21 +0000 https://www.justinsilver.com/?p=4803 I upgraded to FreeNAS 11.2, and then was unable to run pkg with an error about being unable to find the local repo file. pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No...

The post Fix pkg on FreeNAS 11.2 appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

I upgraded to FreeNAS 11.2, and then was unable to run pkg with an error about being unable to find the local repo file.

pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No such file or directory

[root@freenas ~]# pkg install ca_root_nss
Updating local repository catalogue...
pkg: Repository local load error: access repo file(/var/db/pkg/repo-local.sqlite) failed: No such file or directory
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!

This can be fixed by editing the configuration files in /usr/local/etc/pkg/repos/, setting toggling the “enabled” parameter to “no” for local.conf and to “yes” for FreeBSD.conf.

sed 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf
sed 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf

You should now be able to install and update using pkg.

The post Fix pkg on FreeNAS 11.2 appeared first on Justin Silver.

]]>
https://www.justinsilver.com/random/fix-pkg-on-freenas-11-2/feed/ 14
Service Process Start, Service Start Process https://www.justinsilver.com/technology/linux/service-process-start-service-start-process/?utm_source=rss&utm_medium=rss&utm_campaign=service-process-start-service-start-process https://www.justinsilver.com/technology/linux/service-process-start-service-start-process/#respond Sat, 12 Apr 2014 07:35:20 +0000 http://justin.ag/?p=3418 I may be slightly dyslexic as I am constantly typing service start nginx or service restart mysqld when interacting with services controlled via init.d. Rather than making myself constantly retype it I created a...

The post Service Process Start, Service Start Process appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

I may be slightly dyslexic as I am constantly typing service start nginx or service restart mysqld when interacting with services controlled via init.d. Rather than making myself constantly retype it I created a shell script that would reverse it for me, and then just linked the script to the various commands I wanted to use service with.

#!/bin/sh
# description:  This reverses the last argument since I screw it up all the time.
# processname:  service-reverser

EXEC=`echo "$0 $1" | sed -e 's/\/etc\/init\.d\/\(.*\) \(.*\)/service \2 \1/g'`
$EXEC

Next make the file executable, and then link it up.

chmod +x /usr/local/bin/service-reverser
ln -s /usr/local/bin/service-reverser /etc/init.d/start
ln -s /usr/local/bin/service-reverser /etc/init.d/stop
ln -s /usr/local/bin/service-reverser /etc/init.d/status
ln -s /usr/local/bin/service-reverser /etc/init.d/restart

Now you can reverse the argument and name when using service.

[root@web1 ~]# service status nginx
nginx (pid  17813) is running...
[root@web1 ~]# service nginx status
nginx (pid  17813) is running...

The post Service Process Start, Service Start Process appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/service-process-start-service-start-process/feed/ 0