Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4732 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Here is the output of ls -l from /Library/FileMaker\ Server/Data/Scripts/

-rwxrwxrwx@ 1 fmserver fmsadmin 73 Dec 5 15:17 touch.sh

This is the shell script:


!#/bin/bash

touch /Library/FileMaker\ Server/Data/Documents/touchtest.txt





This is the failure in the FileMaker server logs:





2011-12-05 15:26:59.389 -0500 Information 146 filemaker.hostname.com Schedule "touch" run now by "accountname [123.456.7.8]".

2011-12-05 15:26:59.395 -0500 Error 642 filemaker.hostname.com Schedule "touch" aborted; unexpected error. (-1)

This bash script is being called from a scheduled system script from FMS. Nothing else is attached to it like in a script sequence. I am using the default user ( FMServer ).

What am I missing that is causing this very basic script not to run?

Posted

The shebang line start with #!

#!/bin/bash

touch /Library/FileMaker\ Server/Data/Documents/touchtest.txt

With that wrong the server doesn't know what to launch.

Posted

I actually had that right but in a last ditch effort, I changed it to !# incase for some reason I had that wrong. I copied and pasted that line to the forum. oops. The error remain even with #! Any other thoughts? The script works fine from terminal. It really does not get any simpler than touch to test things out.

Posted

Two ideas:

test from Terminal as user fmserver ( su fmserver ). Does that work?

What is the meaning of the @ in the ls -l output?

Posted

The "@" sign -- which is not documented in the manual page for ls(1) -- indicates that the file has extended attributes. You can use the command 'xattr -l <filename>' to show them.

On touch.sh that command returns:


com.apple.FinderInfo:

00000000  54 45 58 54 21 52 63 68 00 00 00 00 00 00 00 00  |TEXT!Rch........|

00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|

00000020

com.apple.TextEncoding: UTF-8;134217984

Posted

So you're editing with BBEdit ;-)

If you don't know what the root user is, stop here

To act as fmuser without knowing the pw:

- in a Terminal:

# going to root

su

# after entering pw

sudo -u fmserver /Library/FileMaker Server/Data/Scripts/touch.sh

That should execute the script as fmserver.

Posted

The fmserver user was able to execute and create the touch file.

These are the steps I did in terminal. Notice I confirmed I was fmserver.


machine:~ user$ su

Password:

sh-3.2# su fmserver

bash-3.2$ whoami

fmserver

bash-3.2$ /Library/FileMaker Server/Data/Scripts/touch.sh

bash-3.2$

Posted

When in doubt, RTFM.

The docs say you can set user & group for the script to run in. Perhaps using fmserver:fmsadmin is the error here.

I'm out of ideas and don't have a FMS to poke around here.

Posted

The default fmserver account probably does not have privileges to do what the script asks. If creating a file, that file must be within the FMS security bubble. if it's outside, then it likely will not work. BTW, use something like the ChangeMOD utility to check the read/write privileges of the script file itself.

Steven

Posted

i was able to execute it under the fmserver user as revealed by my whoami I did just prior to executing the touchtest.sh as seen above in the thread so why would it be different if run under a scheduled script?

The file is being created in the "Bubble" at /Library/FileMaker Server/Data/Documents/

I did use chmod fmserver:fmsadmin on touchtest.sh The ls -l I placed higher in this thread shows the permissions are correct including that the file is executable. Again, I was able to execute it as fmserver when I used su.

What else might I be missing?

Posted

When in doubt, RTFM.

I hear ya, but that thing lacks some serious detail. Amazing the details it lacks. It would also be nice if there was some more effective error communication to the logs!

Posted

RAID Utility says that the status of each drive is "Good" but that SMART status is Unsupported. I had planned on doing a drive replacement soon. Tracking says the new drives are arriving today.

This topic is 4732 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.