You are not logged in.

#1 2015-11-13 03:28:38

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Error with this script

Hi to everybody, i have to run this script under archbang (under Mint runs perfect) :

#1/bin/sh

if [ "`whoami`" != "root" ];
then
	echo You need to be root to install the service
	echo Login as root or run sudo
	exit 1
fi

cp `dirname $0`/OLicenseServer /etc/init.d/
chmod 755 /etc/init.d/OLicenseServer
/etc/init.d/OLicenseServer start

exit 0 

Obviously it does not work on arch because there is not the init.d folder. How can i run this script on "systemctl" system?

Last edited by Major Tom (2015-11-15 06:28:02)

Offline

#2 2015-11-13 19:28:41

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

It's not the usual type of startup script (with a case statement for stop|start|restart and so on) but I'd go with something like this:

1) Create a file called /etc/systemd/system/OLicenseServer (the actual name is your choice)

2) The file should, at it's most simple, look like this

[Unit]
Description=OLicenseServer control

[Service]
ExecStart=/path/to/OLicenseServer start
#ExecStop=/path/to/OLicenseServer stop # if this is implemented in the script

[Install]
WantedBy=multi-user.target

3) # systemctl enable OLicenseServer

There are many more options but this should get you started

Offline

#3 2015-11-14 02:53:24

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

Hi, thaks for the answer. But i don't understand those things:

1) I've to create a file in /etc/systemd/system/OLicenserServer (for example with)

 sudo nano /etc/systemd/system/OLicenseServer 

or i can create this file in my home and than run it with:

 systemctl enable OLicenseServer 

?

2) With the script there are some stuff (others files and scripts) in the same direcotory (/opt). Do i have to move these files with the new script in /etc/systemd/ .... ?

3) If i create a file in /etc/systemd/system with 

 sudo nano /etc/systemd/system/OLicenseServer 

and than

 sudo systemctl enable OLicenseServer 

i've get this error:

 Failed to execute operation: No such file or directory 

.

Can anyone help me ?

Offline

#4 2015-11-14 06:17:05

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

can you post the contents of OLicenseServer ?  The systemd unit replaces the init.d script so you have to tell it to do what the init.d script does

Offline

#5 2015-11-14 07:01:14

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

#! /bin/sh
# Copyright (c) 2003-2007 Optimum GmbH, Karlsruhe, Germany.
# All rights reserved.
#
# Author: AF
#
# This file was automatically created by the first start of the program itself.
# Future starts will not change this file, i.e. changes by hand are allowed.
# If the program is started with '-uninstallService', this file will be removed!
#
### BEGIN INIT INFO
# Provides: OLicenseServer
# Required-Start: $network 
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:    OLicense Server
### END INIT INFO

startwd=/opt/Optimum/OLicenseServer

LD_LIBRARY_PATH=$startwd:$startwd/lin
export LD_LIBRARY_PATH

#
case "$1" in
    start)
        echo -n "Starting OLicense Server"
        cd $startwd
        $startwd/olicenseserver.lin
	sleep 3
	$startwd/spckssq86 `pidof olicenseserver.lin`
        ;;
    stop)
        echo -n "Stopping OLicense Server"
        cd $startwd
        $startwd/olicenseserver.lin -stopService
        ;;
    restart)
        $0 stop
        echo -n "Waiting 10 sec...; "
        sleep 10
        $0 start
        ;;
    suspend)
        echo -n "Suspending OLicense Server"
        cd $startwd
        $startwd/olicenseserver.lin -suspendService
        ;;
    resume)
        echo -n "Resuming OLicense Server"
        cd $startwd
        $startwd/olicenseserver.lin -resumeService
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|suspend|resume}"
        exit 1
        ;;
esac

Offline

#6 2015-11-14 20:29:40

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

This it going to make things a little more complicated since you need to set environmental variables and the appropriate way is to use /etc/sysconfig/*

It's probably easier to adjust your systemd service file to be something like this

$ cat /etc/systemd/system/etcinitd.service 
[Unit]
Description=startup scripts

[Service]
ExecStart=/etc/init.d/main.script

[Install]
WantedBy=multi-user.target

Then create a script called /etc/init.d/main.script

$ cat /etc/init.d/main.script 
#!/usr/bin/bash

for script in /etc/init.d/*.sh
do
  $script start
done
exit 0

And finally put the OLicenseServer in /etc/init.d but make sure it has a .sh suffix
Basically, anything you put in /etc/init.d/*sh will get run at boot, not just this one

Offline

#7 2015-11-15 02:33:20

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

If i try with command "cat" i have these errors:

 cat /etc/systemd/system/etcinitd.service 
File o directory non esistente

[zeno@arch ~]$  cat /etc/init.d/main.script 
cat: /etc/init.d/main.script: File o directory non esistente 

So i create file in /etc/systemd/system/etcinitd.service with

 sudo nano /etc/systemd/system/etcinitd.service
... (write the code) 

But i can't to create the script in /etc/init.d/main.script

 sudo nano /etc/init.d/main.script
...(write the second code) ... Errore:  File o directory non esistente 

So now:

 cat /etc/systemd/system/etcinitd.service 
[Unit]
Description=startup scripts

[Service]
ExecStart=/etc/init.d/main.script

[Install]
WantedBy=multi-user.target

cat /etc/init.d/main.script 
cat: /etc/init.d/main.script: File o directory non esistente

I know that it's in italian but it's easy to translate. Thank you.

Last edited by Major Tom (2015-11-15 06:28:44)

Offline

#8 2015-11-15 06:03:51

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: Error with this script

Is init.d directory in /etc? Error sounds like it is missing or has odd permissions.


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#9 2015-11-15 06:53:00

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

Okay, i followed two steps:

1) i created the init.d folder manually with

 sudo mkdir /etc/init.d 

. After a run the script in /opt with

 sudo sh install_olicense.sh 
Starting OLicense Serverolicenseserver.lin: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
OLicense Server 4.7.2 Linux x86 Crack by TeAM SolidSQUAD-SSQ
Missing arguments

. And Server doesn't work.

2) I created the script in /etc/systemd/system/etcinitd.service with

 sudo nano /etc/systemd/system/etcinitd.service 
[Unit]
Description=startup scripts

[Service]
ExecStart=/etc/init.d/main.script

[Install]
WantedBy=multi-user.target 

After that i made the second script in /etc/init.d/main.script with

 sudo nano /etc/init.d/main.script 
#!/usr/bin/bash

for script in /etc/init.d/*.sh
do
  $script start
done
exit 0 

In the init.d direcoroty there is Main.script ; OLicenseServer (i renamed the file so the suffix is .sh) and i put in install_olicense.sh. If i run install_olicense.sh in /opt/Optimum/OLicenseServer or in /etc/init.d i have the same the results:

 cp: "./OLicenseServer" e "/etc/init.d/OLicenseServer" sono lo stesso file
Starting OLicense Serverolicenseserver.lin: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
OLicense Server 4.7.2 Linux x86 Crack by TeAM SolidSQUAD-SSQ
Missing arguments

.

Offline

#10 2015-11-15 06:58:43

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

What if you just run "sudo /etc/init.d/OLicenseServer.sh start"

You're doing the installation part manually by creating the /etc/init.d and creating the service file so the 'install' script shouldn't have to be run.  However, you're also trying to launch a binary that might have requirements not met.

Offline

#11 2015-11-15 12:33:31

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

 [zeno@arch init.d]$ sudo sh OLicenseServer.sh start
Starting OLicense ServerCannot install autoboot feature >>

OLicense Server 4.7.2 Linux x86 Crack by TeAM SolidSQUAD-SSQ
Missing arguments

.

And server doesn't run.

Offline

#12 2015-11-15 19:00:33

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

try running it like this:
sudo sh -x OLicenseServer.sh start

It will still error out but it might give more a hint about what it's expecting.

Offline

#13 2015-11-16 14:43:38

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

 [zeno@arch init.d]$ sudo sh -x OLicenseServer.sh start
+ startwd=/opt/Optimum/OLicenseServer
+ LD_LIBRARY_PATH=/opt/Optimum/OLicenseServer:/opt/Optimum/OLicenseServer/lin
+ export LD_LIBRARY_PATH
+ case "$1" in
+ echo -n 'Starting OLicense Server'
Starting OLicense Server+ cd /opt/Optimum/OLicenseServer
+ /opt/Optimum/OLicenseServer/olicenseserver.lin
+ sleep 3
olicenseserver.lin: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
++ pidof olicenseserver.lin
+ /opt/Optimum/OLicenseServer/spckssq86
OLicense Server 4.7.2 Linux x86 Crack by TeAM SolidSQUAD-SSQ
Missing arguments 

Offline

#14 2015-11-16 17:52:07

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Error with this script

This looks like the version of glibc that compiled the server.lin binary doesn't match or is incompatible with what you have installed.

If you step through the output, it's all good until this:

olicenseserver.lin: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
++ pidof olicenseserver.lin

"pidof <whatever>" should be returning the PID but since nothing comes back I'm assuming the spckssq86 binary is the thing complaining about the missing argument.  The locale/glibc thing is the root cause though and it's not something you can easily fix on Arch (and it would defeat the object of Arch to get it running)

TBH though, some of the output still doesn't make total sense to me

Offline

#15 2015-11-16 23:24:19

eric
Member
Registered: 2015-07-10
Posts: 240
Website

Re: Error with this script

Major Tom wrote:
 [zeno@arch init.d]$ sudo sh -x OLicenseServer.sh start
+ startwd=/opt/Optimum/OLicenseServer
+ LD_LIBRARY_PATH=/opt/Optimum/OLicenseServer:/opt/Optimum/OLicenseServer/lin
+ export LD_LIBRARY_PATH
+ case "$1" in
+ echo -n 'Starting OLicense Server'
Starting OLicense Server+ cd /opt/Optimum/OLicenseServer
+ /opt/Optimum/OLicenseServer/olicenseserver.lin
+ sleep 3
olicenseserver.lin: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
++ pidof olicenseserver.lin
+ /opt/Optimum/OLicenseServer/spckssq86
OLicense Server 4.7.2 Linux x86 Crack by TeAM SolidSQUAD-SSQ
Missing arguments 

may be it can help
original source here : https://www.reddit.com/r/archlinux/comments/3g9dzf/

[–]rancidfrog 1 point 3 months ago*
Try this to see if the following fixes the issue, as it seems to work for me:
Delete file: etc/locale.gen
reInstall: sudo pacman -S glibc
Open new terminal and try whatever you were doing again
I believe the issue, for me at least, was that upon update it did not set up locale-gen correctly.
To verify you can do: cat /var/log/pacman.log
And you should see something like:
[ALPM] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
UPDATE: make sure you delete /etc/locale.gen and close terminal and open a new one!
And, also reinstall: sudo pacman -S lib32-glibc this might be the culprit!
I also tried some of the commands in the wiki: https://wiki.archlinux.org/index.php/Locale
Not sure if it was the locale commands or the reinstallation that did the trick, but closing and opening a new terminal is certainly a factor:
locale -a
locale-gen
localectl set-locale LANG=en_US.UTF-8
If nothing works: I do not know what to tell you - either wait for next update or use a live image to update via pacman|pacstrap (or so I read - thankfully I did not need to, hehehe).
permalink


Obarun : free to control your system

Offline

#16 2015-11-17 01:17:08

Major Tom
Member
Registered: 2012-12-21
Posts: 23

Re: Error with this script

Okay, guys, this is my confession. I know that probably i've broke the rules of this forum and i've cheat all the community's values. I'm regreftul and i'm embarassed for my behavior. I only say sorry and i hope that you can excuse me. Probably i will get a ban but it don't care.

This script is a crack for a program. I don't show the torrent's link.

Offline

Board footer

Powered by FluxBB